Reputation: 3486
I am trying to use JQuery to change the content of all the .valueInput
tags with a string.
Here is my code, which doesn't seem to do anything:
fiddle: https://jsfiddle.net/p4yvq0vp/2/
html
<div class='main'>
<span class='valueInput'></span>
<span class='valueInput'></span>
<span class='valueInput'></span>
</div>
jquery
$document.ready(function() {
$('.valueInput').text('hi');
});
Upvotes: 0
Views: 43
Reputation: 1069
Solution:
$(document).ready(function() {
$('.valueInput').each(function() {
$(this).text('hi!');
});
});
https://jsfiddle.net/vuz5ygur/
Upvotes: 1