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>