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

187
Visualizações
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 à 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