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

196
Vistas
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
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