Created
October 11, 2015 18:15
-
-
Save superfine/82c18ee29f0e9b7f354d to your computer and use it in GitHub Desktop.
removes the value from the search input with non-jQuery JavaScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// removes the value from the search input with non-jQuery JavaScript | |
function freez(obj) { | |
var id = obj.id; | |
if (obj.value == '') { | |
obj.value = defaultSearchValue[id]; | |
} else if (!defaultSearchValue[id]) { | |
defaultSearchValue[id] = obj.value; | |
obj.value = ''; | |
} else if (obj.value == defaultSearchValue[id]) { | |
obj.value = ''; | |
} | |
} | |
// hint: search inputs need an id to function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment