Tengo esto:
<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>Pasa los valores de datos al modal de arranque. Sin embargo, lo que realmente hace es que establece el valor de los datos que estoy pasando a la identificación de la entrada en el modal:
<input type="text" id="clientcurrentstatus" readonly> Cuando envío esto a la pantalla, muestra el valor de clientcurrentstatus que en este caso está activo. Sin embargo, cuando trato de acceder al valor de la id , no funciona y en su lugar me muestra esto:
console.log(document.getElementById('clientcurrentstatus').value) ¿Cómo puedo acceder a este valor de la id ?