1.form表单实现
<html>
<form name="f1" method="post" action="login.asp">
用户名:<input type="text" name="fuser"><br>
密 码:<input type="password" name="fpwd"><br>
<input type="submit" name="b1" value="提交">
</html>
2.jQuery触发事件
<div>
<input type="text" id="search" name="search" size="28"/>
<button id="go">GO</button>
</div>
<div id="result" class="result"></div>
<script type="text/javascript">
$(document).ready(function(){
var txt = $(":text");
$(this).keyup(function(e){
if(e.keyCode == 13){
txt.focus();
}
});
txt.keyup(function(e){
if(e.keyCode == 13){
$("#go").click();
}
});
});
$(document).ready(function() {
$("#go").bind('click',function(){
var search = $("#search").val();
var resultmsg = "Your are searching text"+"<b>"+'\"'+search+'\"'+"</b>";
$("#result").html(resultmsg);
$("#search").val(""); //clear search text
});
});
</script>