I created my problem on JSFiddle at https://jsfiddle.net/kgw0x2ng/5/ . The code is as follows
HTML code
<div class="loading">Loading…</div> <button type="submit" onClick="hideButton()">Hide</button> <button type="submit" onClick="showButton()">Show</button>
Js code
function hideButton(){ $(".loading").hide(); } function showButton(){ $(".loading").show(); }
I am showing a spinner, and I would like the spinner to hide when I click the Hide button. I get the following error:
Uncaught ReferenceError: showButton is not defined at HTMLButtonElement.onclick (VM282:180) onclick @ VM282:180 VM282:179 Uncaught ReferenceError: hideButton is not defined at HTMLButtonElement.onclick (VM282:179) onclick @ VM282:179.
Can anyone suggest a solution?
thanks
Sechin
source share