This article ish5eduAgency officialHTML5 Trainingtutorials, the main introduction:JavaScript Intensive TutorialsDOM Programming in the--jquery
Dom programming in the JavaScript Hardening tutorial--jquery This article is the official &NBSP;HTML5 training tutorial for H5EDU , the main introduction: JavaScript Intensive Tutorial -- DOM programming DOM programming in jquery----------------------------JS in DOM programming creating a Label object var p= Document.createelement ("P"); var img=document.createelement ("img"); Set the contents of the label p.innerhtml= "Nice Weather"; p.id= "P01"; img.src= " Xx.png "; add another label in one label p.appendchild (IMG); P.insertbefor (IMG); <p id= "P01" > nice weather </p> get a Label object var obj=document.getelementbyid ("P01"); js set the label style obj.style.color= "Red"; obj.classname= "Select"; Settings tab Properties Obj.setattribute---------------------------------------------------JqueRY in DOM programming Create Object 1 $ ("<p>hello</p>") 2.$ (" <div/> "). CSS (). html (). appendto $ (" #div1 "). Append ($ (" <p/> "). CSS ( ). HTML ()); set the object properties $ ("#xm"). attr ("Checked", "true"); set the style of the object $ ("#div1"). CSS ("Properties", "property Values"), $ ("#div1"). CSS ({" Property 1 ":" Property Value "," Property 2 ":" Property Value "}); set the label content $ (" #p1 "). HTML (" This is a P-label "); Add another label in one label $ ("#div1"). Append (obj); $ ( "#div2"). befor (obj);-----------------------------------------------
Click to enter JS Intensive tutorial
This article is from the "11721999" blog, please be sure to keep this source http://11731999.blog.51cto.com/11721999/1833870
Dom programming in the JavaScript intensive tutorial--jquery