Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

83
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda