Turning Learners Into Developers
Codekilla
CODEKILLA
back to course
Lesson 40 / 8746%
HTML / DOM Manipulation3/12

prop() vs attr()

Use prop() for boolean DOM state (checked, disabled, selected).

// 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?