Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <input onchange="alert('value changed!');" />
- document.getElementById("my_text_input").onchange = function(){
- alert("value changed!");
- }
- (function(){
- var changed = false;
- document.getElementById("my_text_input").onchange = function(){
- changed = true;
- }
- document.getElementById("my_text_input").onblur = function(){
- if (!changed) {
- //Your logic here
- }
- changed = false; //set it back to false for next loss of focus
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement