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

126
Views
cambiar css basado en la variable js

Estoy pasando una variable llamada editable desde mi backend, que es true o false como variable. una vez que se pasa al front-end, tengo acceso a él. Quiero hacer algo como esto:

 if ('<%= editable %>' == true) { //change the input tag (in css) to be able to be edited. }

tengo este código en la etiqueta <style> :

 input { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; }

¿Cómo puedo hacer esto?

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

0

Agradezco los comentarios de todos. He descubierto una solución muy viable para esto, espero que pueda ayudar a todos en el futuro.

 function test () { if ('<%= editable %>' != 'yes') { var x = document.getElementsByTagName("input"); for ( var counter = 0; counter < x.length; counter++){ x.item(counter).readOnly = true } } }

y luego onload="test()" en la etiqueta del body .

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!