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

265
Views
How to access the value of input id javascript?

I have this:

<script>
  $(function() {
    $('#clientStatus').on('show.bs.modal', function(event) {
      var button = $(event.relatedTarget); // Button that triggered the modal
      var theclientCurrentStatus = button.data('clientcurrentstatus'); // Extract info from data-* attributes
      var clientusername = button.data('clientusername');
      // $("#radio_1").prop("checked", true); 
      // If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
      // Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
      var modal = $(this);
      modal.find('#clientcurrentstatus').val(theclientCurrentStatus);
      modal.find('#clientusername').val(clientusername);
    });
  });    
</script>

It passes the data values to the bootstrap modal. However, what it actually do is that it sets the value of the data I am passing to the id of the input in the modal:

<input type="text" id="clientcurrentstatus" readonly>

When I output this to screen, it shows the value of clientcurrentstatus which in this case is active. However, when I try to access the value of the id, it doesn't work and instead show me this:

console.log(document.getElementById('clientcurrentstatus').value)

How can I access this value of the id?

about 4 years ago · Juan Pablo Isaza
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!