1
I need help with the javascript code, I’m new and I’m not really sure what the syntax is. What I need is to take the value of this button and play on the id_usuario label, as I do?
<button data-target="modal1" class="negar" value="{{item.id}}" class="btn modal-trigger blue"><i class=" large material-icons ">clear</i
<!-- Modal Structure -->
<div id="modal1" class="modal">
<div class="modal-content">
<h4>Motivo</h4>
<form method="POST" action="." class="viewform" id="formMotivo">
<label id=id_usuario> </label>
<button type="submit" name="salvar" class="btn btn-primary btn-lg">Salvar</button>
</form>
</div>
<div class="modal-footer"></div>
</div>
script>
$(document).ready(function(){
**document.getElementById("id_usuario").innerHTML = btn(negar).value;**
});
If it does not depend on user interaction why not put there directly the
{{item.id}}
? Or you can take othersids
?– Isac
It is a for, it has several rows of the table, therefore several ids, when clicking the button of that line it is taking the id of that user
– Bianca C.