Which jQuery method is used to append content to the end of selected elements?
Correct answer
A. append()
15 views
A. append()
15 views
append() inserts content at the end of each selected element, inside it: $("ul").append("<li>New</li>").
prepend() inserts at the beginning, while after() and before() insert outside the element. attach(), addToEnd() and insert() are not jQuery methods.
Want more practice? Try the full set of Computer Science MCQs on MCQsExam.com.
Not sure why the answer is A? Ask here and get an explanation.