2
I have the following situation where I have this input
<input type='text' class='form-control' value='' id='textInput'>
and I have the span
<span date-dados='' class='j_details_action '></span>
the goal is to take what is typed in the input and put inside the span attribute date-data the code works more the input is inside a foreach where it can have more than one input when it has two input the java script works only for the first input . each input has a span example
<input type='text' class='form-control' value='' id='textInput'>
<span date-dados='' class='j_details_action '></span>
inside a foreach would look like this
<input type='text' class='form-control' value='' id='textInput'>
<span date-dados='' class='j_details_action '></span>
<input type='text' class='form-control' value='' id='textInput'>
<span date-dados='' class='j_details_action '></span>
already has the following code in jquery
$('#textInput').on('keyup', function(){
$(".j_details_action").attr("date-dados", $('#textInput').val());
});
You can do this only with JS/jQuery. PHP runs on the client side and it won’t help you with this problem. Have you tried anything? Could [Edit] and add the code and describe what was the result obtained?
– Woss