<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="jquery-1.9.0.min.js" ></script>
<!-- http://www.jb51.net/article/120018.htm Jquery中.bind()、.live()、.delegate()和.on()之间的区别详解 -->
<script type="text/javascript">
$(function(){
$("#name1").bind('click',function(){
//alert($("#name1").val("2"));
//$("#name1").attr("value","3");
})
$("#name2").bind('click',action);
function action(){
alert($("#name2").val("2"));
}
document.getElementById("name3").addEventListener('click',function(){
$("#name3").val("33");
},false)
//与JQuery冲突
document.getElementById("name4").attachEvent("onclick",function(){
$("#name4").val("44");
})
});
</script>
</head>
<body>
<input id="name1" name="name1" value="value1" />
<input id="name2" name="name2" value="value2" />
<input id="name3" name="name3" value="name3" />
<input id="name4" name="name4" value="name4" />
</body>
</html>