hey guys, i have the following code that will clear a default value in a form field upon focus and return it upon blur. now this works in chrome, ff but not on my IE8 (Windows XP). however... it does work on same browser on the website jsfiddle.net - this is doing my head in and was wondering if anyone can point me in the right direction for fixing...
also, this is the jquery script i am using...Code:<script type="application/javascript"> $(document).ready(function() { // replaces default values in forms $('.default-value').each(function() { var default_value = this.value; $(this).bind('focus', function() { if(this.value == default_value) { this.value = ''; } }); $(this).bind('blur', function() { if(this.value == '') { this.value = default_value; } }); }); }); </script> <input type="text" name="filter_name" class="default-value" value="Keyword search..." />
Code:<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>


Reply With Quote
Bookmarks