jQuery html() Method





jQuery html() Method

jQuery html() method is used to set or return the content (innerHTML) of the selected HTMLelements.
Syntax

When the jQuery html method is used to return the content, it return the content of the FIRST matched HTMLelement. jQuery HTML method will overwrite the content of all the matched HTML attributes when it is used to set the content

Example

The above jquery html() method example will produce the following output


jQuery html() method
Try It Now

jQuery DOM Reference

Other Advanced jQuery and DOM topics you might want to learn
jQuery Basic DOM Methods

jQuery DOM Removal

jQuery DOM Insertion Inside

jQuery DOM Insertion Outside

jQuery DOM Insertion Around


Sources and Credits

The content and methods in the tutorial has been referred and updated with jQuery API and The jQuery Foundation

Last Updated Jul 21, 2015, 12:00:06 PM