How can i set value for each #path (not only for first)?
<input id="path"/>
<input id="path"/>
Code:
$('#path').each(function() {
$('#path').val("123");
});
How can i set value for each #path (not only for first)?
<input id="path"/>
<input id="path"/>
Code:
$('#path').each(function() {
$('#path').val("123");
});
Id should be unique, use a class instead.
<input class="path"/>
<input class="path"/>
$('.path').val("123");
And when you are setting a common value by using a class selector, there is no need to iterate.