First knowledge of jquery

Source: Internet
Author: User

<!DOCTYPE HTML><HTML><HeadLang= "en">    <MetaCharSet= "UTF-8">    <title>Test</title>    <Scripttype= "Text/javascript"src= "Js/jquery-1.12.4.js"></Script>    <Scripttype= "Text/javascript">        $(function(){            //using Innerhtml,innertext,value in DOM to get content            varDom=document.getElementById ("Box"); //alert (DOM); Show [Object Htmldivelement]            varresult=dom.innerhtml; //alert (result);//Display <p> today is July 1, 2017,<span> 20 anniversary of Hong Kong's reunification! </span></p>            varRESULT1=Dom.innertext;  alert (RESULT1); //Show today is July 1, 2017, the 20 anniversary of Hong Kong's reunification!             //var result2 = Dom.value; This is not the case here because only the form element has value            //table cell is known as: ①input ②select-option③ multi-line text field <textarea>            //jquery uses text (), HTML (), Val () to get the content,            varRESULT3=$("Div"). text (); //alert (RESULT3); Show today is July 1, 2017, the 20 anniversary of Hong Kong's reunification!             varRESULT4=$("Div"). html (); //alert (RESULT4)//Display <p> today is July 1, 2017,<span> the 20 anniversary of Hong Kong's reunification! </span></p>            //the transformation of Dom and jquery            //Dom transforms into jquery            varRESULT5=$ (DOM). text (); //jquery converted to Dom            varJQ=$("Div"); varresult=jq[0].innerhtml; //or var result = Jq.get (0). InnerHTML;        }); </Script></Head><Body><DivID= "box">    <P>Today is July 1, 2017,<span>The 20 anniversary of Hong Kong's reunification!</span></P></Div></Body></HTML>

First knowledge of jquery

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.