What is the best way to ignore running code when a button is clicked? I am trying the following but I currently get not reaction how I want it done.
if (!document.getElementById('btn_Cancel').getAttribute('onclick')) {
// code not to be ran when button is clicked
By default code gets ran when a textbox goes onblur so do not want that code ran when button gets clicked
}
You’re going to want to make a reference to that element, so you don’t end up looking it up each time it’s clicked and you’ll need a variable to keep track of whether it’s been clicked or not: