Examples of Jquery basic object conversion and document loading usage
This article mainly introduces Jquery's basic object conversion and document loading usage. The example analyzes Jquery's basic object conversion and document loading usage skills, which has some reference value, for more information, see
This document describes the basic object conversion and document loading usage of Jquery. Share it with you for your reference. The details are as follows:
The Code is as follows:
<! Doctype html public "-// W3C // dtd html 4.01 Transitional // EN"
Http://www.w3.org/TR/html4/loose.dtd>
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> New Web Project </title>
<Script src = "jquery-1.8.3.js" type = "text/javascript"> </script>
</Head>
<Body>
<H1> New Web Project Page <Input type = "button" value = "aa" id = "but"/>
</Body>
<Script type = "text/javascript">
Var a = $ ('# but'). val ();
Document. write ();
$ (Document). ready (function (){
Alert ("method of calling after the first document is loaded! ");
});
$ (Function (){
Alert ("second method of calling after the document is loaded! ");
});
$ (Function (){
Var but = $ ('# but'); // jquery object
Var jsBut = but. get (0); // convert a jquery object to a js object
JsBut = but [0]; // convert a jquery object to a js object
But = $ (jsBut); // convert a js object to a jquery object
});
</Script>
</Html>
I hope this article will help you with jQuery programming.