JQuery fallback function for CSS3 placeholder -


the following function should ensure if device not have css3 abilities should set value instead. not work. there no value present in non css3 browsers. here fiddle. http://jsfiddle.net/x9zzp/2/

// search input placeholder  $(document).ready(function(){ if(!modernizr.csstransitions) {     $('#gensearch').val($('#gensearch').attr('plaeholder'));     $('#gensearch').click(function() {         $(this).val('');     });     $('#gensearch').blur(function() {         if($(this).val() == '') {             $(this).val($(this).attr('plaeholder'));         }     }); } }); 

any ideas,

marvellous

spelling mistake, thats annoying. sorry everybody.

$(document).ready(function(){ if(!modernizr.csstransitions) {     $('#gensearch').val($('#gensearch').attr('placeholder'));     $('#gensearch').click(function() {         $(this).val('');     });     $('#gensearch').blur(function() {         if($(this).val() == '') {             $(this).val($(this).attr('placeholder'));         }     }); } }); 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -