我有麻煩使輸入鍵擊中搜索按鈕....請幫助我。先謝謝你。使輸入鍵點擊搜索按鈕
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
........
<script type="text/javascript" src="js/jquery.js"></script>
<script src="../jQueryAssets/jquery-1.8.3.min.js" type="text/javascript"></script><script type="text/javascript">
function get() {
$.post ('data/data.php', { word: form.name.value },
function (output) {
$('#defination') .html(output).show() ;
});
}
</script>
.............
<form name ="form">
<div align="center">
<pre> <input name="name" type="text" autofocus required placeholder="Please enter a Word !" size = "70" maxlength="50" >
</pre>
<p>
<input type="button" onClick="get();" value="Search" size = "30" >
.........
</html>
使用的onsubmit,不是的onclick。另外,讓你的提交按鈕一個提交按鈕。爲什麼你的函數名爲「get」,如果它發佈? –
這和PHP有什麼關係? – hendr1x