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

192
Views
edit contents of elements based on custom markers (like ** bold **)

I was wondering if it was possible to change text-styles if there is a marker surrounding the text (like in discord messages)
My approach would be to first get all the elements of the page that (usually) contain text

const getTagName = (x) => document.getElementByTagName(x);
let p = getTagName("p");
let h1 = getTagName("h1");
let h2 = getTagName("h2");
let h3 = getTagName("h3");
let h4 = getTagName("h4");
let h5 = getTagName("h5");
let h6 = getTagName("h6");
//there are probbably much more text-containing-elements, but for here i dont really care

Then i would look through them to find for example "**" ... "**" and put the contents in a <span style="font-weight: 900">\</span> element. And here is my problem: I don´t see a 'usual' way to do this. Can anyone help?

about 4 years ago · Juan Pablo Isaza
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!