This week is doing front-end page development, with jquery knowledge more, convenient later use, do a small summary of it.
Empties all child elements under an element:
$ ("#tickey_content"). empty ();
Loop value:
$.each (contents, function (I, item) {
Gets the text inside the LABEL element:
$ ("#role"). Text ()
Set the text inside the LABEL element:
<pre name= "Code" class= "JavaScript" >$ ("#role") <span style= "font-family:arial, Helvetica, Sans-serif;" >.html (UserName);</span>
Get the text inside the TEXTAREA element:
$ ("#reply"). Val ();
Empty the text inside the TEXTAREA element:
$ ("#reply"). Val ("");
jquery may be an element:
$ ("#content_template"). Clone ();
Gets the first child element under an element:
Templatediv.children (": First");
Gets the next element of an element:
Templatediv.next ();
Gets the last element under an element:
Contenttemplate.children (": Last");
Delete an attribute of an element, such as an ID:
To add a CSS property to an element:
Templatediv.css (' Display ', ' block ');
Add a class attribute to an element:
Divelement.addclass ("Engineerstyle");
Add the href attribute to the A tag:
$ ("#aElement"). attr ("href", "${ctx}" +filepath+filename);
Add a new element under an element:
$ ("#tickey_content"). Append (Templatediv);
Add an element to the front of an element:
Divelement.prepend (content);
The JS string determines whether a character is included:
Role.indexof (' engineer ') >=0
jquery Usage Summary