jquery - Html 5 plachold text with plugin - How to remove the focus from textbox -


i have implemented ie8 support placehold plugin, enabled in text box first time there focus set text showing there when first loads page. if click outside of text page, message showing.

i'm following http://www.jacklmoore.com/notes/form-placeholder-text/ plugin , in text box every thing looks good.

// jquery based placeholder polyfill $(document).ready(function(){   function add() {     if($(this).val() === ''){       $(this).val($(this).attr('placeholder')).addclass('placeholder');     }   }    function remove() {     if($(this).val() === $(this).attr('placeholder')){       $(this).val('').removeclass('placeholder');     }   }    // create dummy element feature detection   if (!('placeholder' in $('<input>')[0])) {      // select elements have placeholder attribute     $('input[placeholder], textarea[placeholder]').blur(add).focus(remove).each(add);      // remove placeholder text before form submitted     $('form').submit(function(){       $(this).find('input[placeholder], textarea[placeholder]').each(remove);     });   } }); 

please see below jsfiddle


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -