Home >Web Front-end >JS Tutorial >JavaScript method to display loading after clicking the submit button_javascript skills

JavaScript method to display loading after clicking the submit button_javascript skills

WBOY
WBOYOriginal
2016-05-16 15:51:282087browse

The example in this article describes the method of using JavaScript to display loading after clicking the submit button. Share it with everyone for your reference. The details are as follows:

Here you can display the loading after clicking the submit button to prevent users from submitting repeatedly

<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>

I hope this article will be helpful to everyone’s JavaScript programming design.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn