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

JavaScript HTML DOM ???

Event

???? ??, ??, ??? ?? ? ???? ???? ??? ???? ?? ??? ???? ??? ?????.

???? JavaScript? DOM ??? ?????.

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

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

???? ??

???? HTML ??? ???? ? ???? ???? JavaScript? ??? ? ????.

???? ??? ??? ? ??? ????? HTML ??? ??? JavaScript ??? ?????.

onclick=JavaScript

HTML ???? ?:

???? ???? ??? ?

???? ??? ?

???? ????? ?

?? ?? ???? ??? ?

?? ??? ??? ?

HTML ??? ??? ?

???? ? ???? ??? ?

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>php中文網(wǎng)(php.cn)</title>
</head>
<head>
<script>
function changetext(id){
id.innerHTML="hello";
}
</script>
</head>
<body>
<h1 onclick="changetext(this)">點擊!</h1>
</body>
</html>

???? ????? HTML ????? ??? ??? ??? ? ????.

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>php中文網(wǎng)(php.cn)</title> 
</head>
<body>
<button onclick="displayDate()">點擊</button>
<script>
function displayDate(){
document.getElementById("demo").innerHTML=Date();
}
</script>
<p id="demo"></p>
</body>
</html>

HTML DOM? ???? JavaScript? ???? HTML ??? ???? ??? ? ????.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>php中文網(wǎng)(php.cn)</title>
</head>
<head>
</head>
<body>
<button id="myBtn">點這里</button>
<script>
document.getElementById("myBtn").onclick=function(){displayDate()};
function displayDate(){
document.getElementById("demo").innerHTML=Date();
}
</script>
<p id="demo"></p>
</body>
</html>


onload ? onunload ???

onload ? onunload ???? ???? ???? ????? ???? ?? ? ?????.

onload ???? ???? ???? ???? ??? ???? ??? ???? ? ??? ???? ??? ??? ? ???? ??? ? ????.

onload ? onunload ???? ???? ??? ??? ? ????.

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>php中文網(wǎng)(php.cn)</title> 
<script type="text/javascript">
    function load(){
        alert("頁面加載完成");
      }
</script>
</head>
<body onload="load()">
</body>
</html>

onchange ???

onchange ???? ?? ??? ??? ??? ?? ?? ?????.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>php中文網(wǎng)(php.cn)</title>
</head>
<head>
<script>
function myFunction(){
var x=document.getElementById("fname");
x.value=x.value.toUpperCase();
}
</script>
</head>
<body>
輸入你的名字: <input type="text" id="fname" onchange="myFunction()">
<p>當你離開輸入框后,將小寫字母轉為大寫字母。</p>
</body>
</html>

onmouseover ? onmouseout ???

onmouseover ? onmouseout ???? ???? ???? HTML ?? ?? ??? ??? ? ??? ????? ? ??? ? ????.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>php中文網(wǎng)(php.cn)</title>
</head>
<body>
<div onmouseover="mOver(this)" onmouseout="mOut(this)" style="background-color:yellow;width:120px;height:20px;padding:40px;">Mouse Over Me</div>
<script>
function mOver(obj){
obj.innerHTML="Thank You"
}
function mOut(obj){
obj.innerHTML="鼠標請移動至此"
}
</script>
</body>
</html>

onmousedown, onmouseup ? onclick ???

onmousedown, onmouseup ? onclick? ??? ?? ???? ?? ??? ?????. ?? ??? ??? ???? onmousedown ???? ????, ??? ??? ??? onmouseup ???? ????, ????? ??? ??? ???? onclick ???? ?????.

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>php中文網(wǎng)(php.cn)</title> 
<script type="text/javascript">
   function noNumbers(e)
    {
    var keynum;
    var keychar;
    keynum = window.event ? e.keyCode : e.which;
    keychar = String.fromCharCode(keynum);
    alert(keynum+':'+keychar);
    }
</script>
</head>
<body>
<input type="text" onkeydown="return noNumbers(event)" />
</body>
</html>

?? ???:

onmousedown ? onmouseup
???? ??? ??? ??? ???? ?????.

onload
??? ??? ???? ???? ??? ?????.

onfocus
???? ?? ? ?? ??? ???? ?????.

??? ???
???? ?? ?? ???? ??? ????, ???? ??? ??? ???? ??? ?? ?????.


???? ??
||
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文網(wǎng)(php.cn)</title> <script type="text/javascript"> function mouseOver() { document.getElementById('div1').style.border = "1px solid red"; } function mouseOut() { document.getElementById('div1').style.border = "1px solid white"; } </script> </head> <body> <div id="div1" style="width:300px;border:1px solid white;" onmouseover="mouseOver()" onmouseout="mouseOut()" > <p style="line-height:2em;text-align:center;">我是一些文字或者圖片</p> </div> </body> </html>