Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

82
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!