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

jQuery事件總結

Original 2018-12-14 11:22:01 346
abstract:<!DOCTYPE html><html><head> <meta charset="utf-8"> <title></title> <script type="text/javascript" src="jq.js"></script><

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<title></title>

<script type="text/javascript" src="jq.js"></script>

</head>

<body>

<input type="text" name="">

<div style="width: 100px;height: 100px;background:pink;">


</div>

<button>點擊</button>

</body>

</html>

<script type="text/javascript">

// ready()//當我們的dom已經加載,頁面已經加載完,觸發(fā)的事件==js的onload

// 語法:

// $(document).ready(function(){

// })不可以和body,onload以前使用

//blur()當元素失去焦點==onblur

$(document).ready(function(){

// $('input').blur(function(){

// $("input").css("background",'red')

// })

// $('input').focus(function(){

//       $("input").css("background",'pink')

// })

// $('input').change(function(){

//       $("input").css("background",'pink')

// })

// $('button').click(function(){

// $('div').css("background","red")

// })

$('button').dblclick(function(){

$('div').css("background","red")

})

})

//focus()當元素獲取焦點時 == js  onfocus()

//change()當元素值改變的時候觸發(fā)事件

//click()點擊事件

//dblclick雙擊的事件



</script>


Release Notes

Popular Entries