= jquery = The purpose of jQuery is to make it much easier to use JavaScript on your website. http://jquery.com/ == DOM ready == {{{#!highlight javascript $(document).ready(function(){ //...... }); //----------- $(document).ready(readyx); function readyx(){ // called on DOM ready } }}} == Find element by id == {{{#!highlight javascript // element id id1234 var x1234 = $("#id1234"); }}} == Find elements by class == {{{#!highlight javascript // element with class classsdf var elements = $(".classsdf"); elements.each( eachHandler ); function eachHandler(index,element){ console.log(index + ' ' +element); } }}} == Get or set select dropdownlist selected value == {{{#!highlight javascript $("#dropdown").val(); //get value $("#dropdown").val('asd'); //select value asd }}} == .attr( attributeName ) == Returns String Get the value of an attribute for the first element in the set of matched elements. == .text() == Returns String Get the combined text contents of each element in the set of matched elements, including their descendants. == html() == Returns String Get the HTML contents of the first element in the set of matched elements. == .append( content [, content ] ) == Returns jQuery Insert content, specified by the parameter, to the end of each element in the set of matched elements. == .empty() == Returns jQuery Remove all child nodes of the set of matched elements from the DOM.