Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Steven Benjamin
- //www.stevenbenjamin.com
- //July 28 2011
- //Open Source Initiative OSI - The MIT License (MIT)
- jQuery(document).ready(function() {
- //add listeners to the search string.
- jQuery("#textBox").click(clearDefaultValue);
- jQuery("#textBox").blur(resetDefaultValue);
- //clear the defaultValue on click.
- function clearDefaultValue(e){
- if (window.console) {console.log('clearFBArtistSearch :',e.currentTarget.defaultValue,e.currentTarget.value)};
- if(e.currentTarget.value === e.currentTarget.defaultValue){
- e.currentTarget.value = '';
- };
- };
- //replace the defaultValue if blank.
- function resetDefaultValue(e){
- if(jQuery.trim(e.currentTarget.value) === ''){
- e.currentTarget.value = e.currentTarget.defaultValue;
- };
- };
- }); //jquery ready
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement