I have the following function:
format : function(){
//function body
if(condition){
//execute this condition only on focus event
}
}
This function is being called on page load and on the focus of an input element. I have a condition within this function that I would like to be called only when this function is called manually from the focus event and not on page load. Is there a way to achieve this?
There are cases sometimes when the 'condition' in the if statement is true on page load as well. Any help will be appreciated. Thanks in advance.
Separate into two functions:
format: function() {
//Do stuff for focus
}
onload: function() {
//Do stuff for onload
this.format();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With