Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

90
Visualizações
wrap selected text inside div in stars vuejs

Hello everyone I'm trying to wrap the selected text inside a text area between 2 stars Entry would be for example vuejs => ** vuejs ** . Though I didn't figure out how to make the selected text wrapped with stars only.

    //this is my text area object
    <textarea class="outline-none w-100" id="textAreaExample3" rows="4" placeholder="taper 
    votre texte" ></textarea>
    //this is the method that gets triggered on a button click when the text gets selected
    makeSelectedTextBold(){
    let text = document.getElementById('question').innerText;
    // selected text
    let selection = window.getSelection().anchorNode.data;
    console.log(selection)
    // wrap text to be shown on button click (I couldn't figure this out can someone help me)
   
    },
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

I don't quite understand what you're trying to do. Make ALL the text in the text area bold, or make the text appear in a console log in bold?

about 4 years ago · Juan Pablo Isaza Relatório

0

This will help with the HTML:

<button id="button" onclick="makeSelectedTextBold()">here<button>
<textarea class="outline-none w-100" id="textAreaExample3" rows="4" placeholder="taper votre texte" ></textarea>

This will help with the JS:

document.getElementById("button").addEventListener("click");
function makeSelectedTextBold(){
    let text = document.getElementById("textAreaExample3").value;
    console.log("text:" + text)
    let selection = window.getSelection();
    console.log("selection:" + selection)
 }    

And this should help with finding and replacing the text: Find and Replace for an Textarea

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda