Cheatsheets :: jQuery Tester


Last Command: $('#d3').css('background-color','yellow')   Last Result:

eval() arbitrary jQuery/JavaScript code:

Use the controls to select an element in the target html. The selection will be shown with a dotted red border.

Then choose an "action" (a jQuery method) to apply to that selection. For example, choose a lightblue background, and apply it with the jQuery css() call. Or set it to visible/hidden with show() or hide() jQuery calls.

The selection and the action are formatted into one javascript statement, then eval()'d within this page. That statement is echoed in the block "Last Command".

HTML Source is just the source of the "demo" div.


The outermost div: id="demo"
First div class="c1"
Another div class="c2" id="d2"
Another div class="c2" id="d3"
Third Div class="c3"
Fourth Div class="c3" span id="span1" span id="span2" This is text and this is bold span id="span3"
Outer div .c1
div within div, .c1
Div class="c3"
hdr 1 hdr 2
cell 1,1 cell 1,2
cell 2,1 cell 2,2
<div id="demo">
</div>