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

189
Views
Rangy: ¿cómo implementar el estilo múltiple?

Estoy usando Rangy para resaltar texto en mi página web. ¿Hay alguna manera de establecer varios estilos para que el usuario elija para resaltar el texto? por ejemplo, cuando el usuario hace clic en un resaltado amarillo, tomo todo el texto con el método getHighlightForElement() pero no sé cómo cambiar la clase/id de color. o cualquier otra sugerencia de manera? gracias !

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

El siguiente código es un simple intercambiador de hojas de estilo. Al hacer clic en el botón "Resaltar 1", se cargará una hoja de estilo denominada "resaltar1.css". La hoja de estilo se intercambiará cuando haga clic en un botón diferente.

 <html lang="en"> <head> <link href="default_highlight.css" rel="stylesheet" type="text/css" id="highlight"> <script> function setHighlight1() { const highlight = document.getElementById('highlight'); highlight.href = 'highlight1'; } function setHighlight2() { const highlight = document.getElementById('highlight'); highlight.href = 'highlight2'; } function setHighlight3() { const highlight = document.getElementById('highlight'); highlight.href = 'highlight_3.css'; } </script> </head> <body> <button onclick="setHighlight1()">Highlight 1</button> <button onclick="setHighlight2()">Highlight 2</button> <button onclick="setHighlight3()">Highlight 3</button> </body> </html>

Espero que esto responda a tu pregunta.

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!