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

138
Views
Cómo cambiar este código javascript a jQuery, especialmente la parte de concatenación de cadenas

Quiero convertir este javascript en jQuery pero no puedo hacerlo

// JavaScript

 var d_Inp = document.getElementById("dollar-input"); var dsign = document.getElementById("dollar-sign"); d_Inp.addEventListener("keyup", () => { let len = d_Inp.value.length; dsign.style.right = `${len + 3}ch`; });

//jQuery

 $(document).ready(function(){ $("#dollar-input").keyup(function(){ let len = $("#dollar-input").val.length; $("label").css("right","len+3+ch"); }) })

Creo que me equivoqué en alguna parte $("label").css("right","len + 3ch"); aquí

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

0

En jQuery necesitas usar val() para obtener el valor de entrada

 let len = $("#dollar-input").val().length

Luego, al agregar css, agregó directamente una cadena en lugar de usar el valor de len

 $("label").css("right",len+3+"ch");
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!