<div class="codetitle"> <span><a style="CURSOR: pointer" data="90673" class="copybut" id="copybut90673" onclick="doCopy('code90673')"><u>Copy code</u></a></span> The code is as follows:</div> <div class="codebody" id="code90673"> <br><script type="text/javascript"> <br> $(document).ready(function(){ <br>$("#submit").click(function(){ <br>$.post("sendPwd.php",{QQnum:$("#QQnum" ).val(),psw:$("#psw").val()},function(data){ <br>$("#aaa").html(data); <br>},"html" ; .php receives the passed value through $_POST, and then echoes a piece of data. However, the returned value cannot be displayed. The reason is here: <br><br><br><br> </div>Copy code<br><br><div class="codetitle"> The code is as follows:<span><a style="CURSOR: pointer" data="82387" class="copybut" id="copybut82387" onclick="doCopy('code82387')"> <u><input type="submit" name="submit" id="submit" value="Submit" /> </u></a> </span>The type of the submit button is submit, and nothing happens after clicking it. Because I accidentally discovered that the result came out once I clicked it, and then changed back, I found it strange. I checked online and found that most of the buttons were set to button type, so after changing it to button, the problem was solved. </div> <div class="codebody" id="code82387">Button What is the difference between button and submit? <br>Submit is mainly used to submit the form. It is a special button that performs the submission action. The button is mainly operated with JavaScript and is itself a button. This is the fundamental difference. If you want to use submit, verification needs to return false. I think it is more convenient to set it as a button.</div>