DOM

html

Adds elements or changes the content of an element on a page. This method has shortcut aliases:

Syntax

x$(window).html( location, html );

or this method will accept just an html fragment with a default behavior of inner...

x$(window).html( htmlFragment );

Arguments

Example

x$('#foo').html( 'inner',  'rock and roll' );
x$('#foo').html( 'outer',  '

lock and load

' ); x$('#foo').html( 'top', '
bangers and mash
'); x$('#foo').html( 'bottom', 'mean and clean'); x$('#foo').html( 'remove' '

first and last

');

Another Example

x$('#foo').html('

sweet as honey

');

More Examples

x$('#foo').inner('rock and roll' );
x$('#foo').outer('

lock and load

' ); x$('#foo').top('
bangers and mash
'); x$('#foo').bottom('mean and clean'); x$('#foo ul li').remove();