Turning Learners Into Developers
Codekilla
CODEKILLA
back to course
Lesson 39 / 8745%
HTML / DOM Manipulation2/12

attr() and removeAttr()

Get/set any HTML attribute.

// where does the new node land? before · prepend · append · after.before('X')<div#target>… target content …</div>.prepend('X')<div#target>… target content …</div>.append('X')<div#target>… target content …</div>.after('X')<div#target>… target content …</div>Click a step to see where the new node lands.
Visual explanation diagram · click steps to walk through it

This lesson is Pro only.

Unlock every premium lesson and module — Pro from ₹299 / month (or ₹999 / year, saves ~₹2,589).

Sign in to unlock
// feedback.matters()
Did this lesson help you?