javascript implements the method of displaying loading after clicking the submit button

  • 2020-07-21 06:41:45
  • OfStack

This article illustrates javascript's method of displaying loading after clicking the submit button. Share to everybody for everybody reference. The details are as follows:

Here, loading can be displayed after clicking the submit button to prevent users from repeatedly submitting


<style>
#loading { 
  position:absolute; 
  width:500px; 
  height:50px; 
  top:50%;
  left:50%; 
  margin: -25px -150px;
  background-color:#FFFFFF;
  border:1px solid #CCCCCC;
  text-align:center;
  padding:20px;
}
</style>
<div id="loading" style="display:none">
<img src="image/ajax.gif" /> Loading...
</div>
<a href="#" onclick="document.getElementById('loading').style.display='';">test</a>

Hopefully, this article has been helpful in your javascript programming.


Related articles: