InterviewSolution
Saved Bookmarks
| 1. |
Explain The Each() Function? |
|
Answer» The each() function specify the function to be called for every matched element. $(SELECTOR).each(function (index, element))
For example $("#clickme").click(function(){$("li").each(function(){ document.write($(this).text()) }); }); This will write the text for each “li” element. The each() function specify the function to be called for every matched element. Syntax: $(selector).each(function (index, element)) For example This will write the text for each “li” element. |
|