Var divs = $(".txt"); this will return a list of divs with a class txt .
I want to add text to a selected div for example :
divs[4].html("Hello World"); this with return error saying divs[4].html is not a function. why ?
Var divs = $(.txt); this will return a list of divs with a class
Share
When you access a jQuery object by its DOM array index, you get the HTML element, not a jQuery object, which doesn’t have the
html()function. Use theeq(n)selector instead: