jQuery implements the method where the submit button is clicked and becomes processing the word and not allowed to click

  • 2020-05-17 04:48:24
  • OfStack

The example in this article shows how jQuery can turn a submit button into an in-process word when clicked and prevent clicking. Share with you for your reference. The specific implementation method is as follows:

Here, the text of the button is mainly set through the val method, and the attr method is used to modify the disabled property to achieve this function.

The main code is as follows:


<html>
<body>
<form method="get" action="" target="box">
<input id="buttonid" type="submit" value=" submit " />
</form>
<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
<script>
$("form").submit(function() {
  $("#buttonid").val(" Are dealing with ...");
  $("#buttonid").attr("disabled", "disabled");
});
</script>
</body>
</html>

I hope this article is helpful to you in jQuery programming.


Related articles: