Set of methods for manipulating the Document Object Model (DOM).
Manipulates HTML in the DOM. Also just returns the inner HTML of elements in the collection if called with no arguments.
x$( window ).html( location, html );
or this method will accept just a HTML fragment with a default behavior of inner:
x$( window ).html( html );
or you can use shorthand syntax by using the location name argument as the function name:
x$( window ).outer( html );
x$( window ).before( html );
or you can just retrieve the inner HTML of elements in the collection with:
x$( document.body ).html();
String
can be one of: inner, outer, top, bottom, remove, before or after.String
is a string of HTML markup or a HTMLElement
.x$('#foo').html('inner', '<strong>rock and roll</strong>');
x$('#foo').html('outer', '<p>lock and load</p>');
x$('#foo').html('top', '<div>bangers and mash</div>');
x$('#foo').html('bottom','<em>mean and clean</em>');
x$('#foo').html('remove');
x$('#foo').html('before', '<p>some warmup html</p>');
x$('#foo').html('after', '<p>more html!</p>');
or
x$('#foo').html('<p>sweet as honey</p>');
x$('#foo').outer('<p>free as a bird</p>');
x$('#foo').top('<b>top of the pops</b>');
x$('#foo').bottom('<span>bottom of the barrel</span>');
x$('#foo').before('<pre>first in line</pre>');
x$('#foo').after('<marquee>better late than never</marquee>');
Gets or sets attributes on elements. If getting, returns an array of attributes matching the xui element collection's indices.
x$( window ).attr( attribute, value );
String
is the name of HTML attribute to get or set.Varies
is the value to set the attribute to. Do not use to get the value of attribute (optional).To get an attribute value, simply don't provide the optional second parameter:
x$('.someClass').attr('class');
To set an attribute, use both parameters:
x$('.someClass').attr('disabled', 'disabled');