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

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

collision detection - C++ library for mesh to mesh intersection: what is available? -

python - Django-easy-pdf: xhtml2pdf reporting reportlab 2.2+ is required, but 3.0 installed -