1. ZZDom selectors
zz( '#', 't1-1' ).text( 'yellow' );
white. Original value is white, modified must be yellow.
zz( '.', 't1-2' ).text( 'yellow' );
- white. Original value is white, modified must be yellow.
- red. Original value is red, modified must be yellow.
zz( 't', 'i' ).text( 'yellow' );
- white. Original value is white, modified must not be changed.
- red. Original value is red, modified must be yellow.
- black. Original value is black, modified must be yellow.
zz( 'n', 'myname' ).text( 'yellow' );
- white. Original value is white, modified must not be changed.
- red. Original value is red, modified must be yellow.
- black. Original value is black, modified must be yellow.
zz( 's', '.t1-5 span.selected' ).text( 'yellow' );
- white. Original value is white, modified must not be changed.
- red. Original value is red, modified must be yellow.
- black. Original value is black, modified must be yellow.
2. Element
zz( document.getElementById( 't2-1' ) ).text( 'yellow' );
white. Original value is white, modified must be yellow.
3. HTMLCollection
zz( document.getElementsByClassName( 't3-1' ) ).text( 'yellow' );
- white. Original value is white, modified must be yellow.
- red. Original value is red, modified must be yellow.
4. NodeList
zz( document.getElementsByName( 'anothername' ) ).text( 'yellow' );
- white. Original value is white, modified must not be changed.
- red. Original value is red, modified must be yellow.
- black. Original value is black, modified must be yellow.
5. Nodes
zz( document.querySelectorAll( '#t5-1 .t5-1' ) ).text( 'yellow' );
- white. Original value is white, modified must not be changed.
- red. Original value is red, modified must be yellow.
- black. Original value is black, modified must be yellow.
6. Standard selectors
zz( '#t6-1 .t6-1' ).text( 'yellow' );
- white. Original value is white, modified must not be changed.
- red. Original value is red, modified must be yellow.
- black. Original value is black, modified must be yellow.
7. HTML code
HTML creates 1 element
zz( -div id="t7-1-in"-New div-div ).appendTo( '#t7-1' )
This is the container t7-1
HTML creates several elements
zz( ... ).appendTo( '#t7-2' )
This is the container t7-2
8. Null
zz( document.querySelectorAll( '#non-existing-id' ) ).text( 'this is useless' );
var instance = zz( document.querySelectorAll( '#non-existing-id' ) );
instance = zz( '#non-existing-id' );
9. Exceptions
Unsupported selector id
zz( 'unknown', 'some text' ).text( 'yellow' );
Unsupported selector type
zz( 1 ).text( 'this is useless' );
10. param
input 1:
input 2: