What am I doing wrong here? Not well versed in js, so assuming I'm doing my for loop wrong.
<div class="date-widget">
hello1
</div>
<div class="date-widget">
hello2
</div>
js
$(document).ready(function() {
var utcInstances = $('.date-widget');
for (i = 0; i < utcInstances.length; i++) {
utcInstances[i].text("new text");
}
});
error:
TypeError: utcInstances[i].text is not a function
utcInstances.text("new text");if you want to give them all the same text.utcInstances.eq(i).text()