nnj 2014-04-20
代码如下:
<html lang="en">
<head>
<meta charset="utf-8">
<title>test</title>
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<input type="checkbox" />
<input type="text" id="test"/>
<input type="button" value="button" id="bnt" onclick="bntClick()"/>
</body>
<script>
$( document ).ready(function() {
$("input[type='checkbox']").bind("click",function(){
$("#test").val("www.baidu.com");
});
});
function bntClick(){
$("input[type='checkbox']").trigger("click");
}
</script>
</html> 本文实例讲述了jquery trigger实现联动的方法。分享给大家供大家参考,具体如下:。<input type="button" value="设置成湖北襄阳" onclick="test()&q