亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

JavaScript - jQuery ???

?? jQuery

JavaScript ?????? ?????? ? ????? ?? ???? ???.

?????? ????? src ??? ?????? URL? ??? <script> ??? ?????.

<!DOCTYPE html>
<html>
<head>
<script src= " http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js">//??? ???
</script>
</head>
<body>
< ;/body>
</html>


jQuery ??

jQuery? ?? ??? $() ??(jQuery ??)???. DOM ??? ? ??? ???? jQuery ??? ??? jQuery ??? ?????.

jQuery? ???? CSS ???? ?? ??? ??? ? ????.

JavaScript??? ? ?? ???? ???? ??? ??? ? ????.

JavaScript ??

function myFunction()
{
var obj=document.getElementById("h01");
obj.innerHTML="Hello jQuery";
}
onload=myFunction;

jQuery ??

function myFunction()
{
???? $("#h01").html("Hello jQuery");
}
$(document).ready (myFunction);

? ??? ??? ???? HTML DOM ?? ??? jQuery: $(document)? ?????.

DOM ??? jQuery? ???? jQuery? HTML DOM ??? ??? jQuery ??? ?????.

jQuery ??? ??? jQuery ??? ????, ? ? Ready()? ??????.

??? JavaScript? ????? myFunction? jQuery? Ready ???? ??? ??? ? ????.

??:


jQuery? ??? DOM ??? ?? jQuery ??? ?????.
jQuery ??? DOM ??? ?? ??? ???? ??? ????.
jQuery ????? HTML DOM ??? ???? ??? ? ????.


?? ??:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>php中文網(wǎng)(php.cn)</title> 
<script src="http://libs.baidu.com/jquery/1.8.3/jquery.min.js"></script>
<script>
function myFunction(){
$("#h01").html("Hello jQuery")
}
$(document).ready(myFunction);
</script>
</head>
<body>
<h1 id="h01"></h1>
</body>
</html>

vs.

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>php中文網(wǎng)(php.cn)</title> 
<script src="http://libs.baidu.com/jquery/1.8.3/jquery.min.js"></script>
<script>
function myFunction(){
$("#h01").attr("style","color:red").html("Hello jQuery")
}
$(document).ready(myFunction);
</script>
</head>
<body>
<h1 id="h01"></h1>
</body>
</html>

?? ??? ? ? ??? jQuery? ??(?? ??)? ?????.

?? ??? ??? ??? ?? ?? ??? ???? ??? ?????.


???? ??
||
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文網(wǎng)(php.cn)</title> <script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ alert($("#runoob").attr("href")); }); }); </script> </head> <body> <p><a href="http://ipnx.cn" id="runoob">php.cn</a></p> <button>顯示 href 屬性的值</button> </body> </html>