javascript - Hiding a button onClick="" before launching the following method calls -


i not familiar inline js. have button such

<button onclick="return dosomething()"></button> 

how hide & disable button before return , dosomething called? (jquery available too).

i need button hidden & disabled before onclick methods called.

you can this:

<button onclick="this.disabled = true;this.style.display = 'none';return dosomething()"></button> 

or in dosomething function:

<button onclick="return dosomething(this)"></button>  function dosomething(obj){     obj.disabled = true;     obj.style.display = 'none'     // other stuff } 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -