How to fix the placeholder issue in IE with Jquery

Today we gonna to learn simple JQuery code to fix the placeholder issue in IE. The idea is to use the given input placeholder text  as input value. This idea is also works in lowest version of IE browser.

Step1:

First of all we get all input object which has placeholder attribute by using  “each” method.Object stored in “el” variable

 Step2:

Then we needs to get the placeholder text by using “attr” method and assign that values to the corresponding input fields

Step3:

Then we used to add and remove placeholder text to input values by using “focus” and “blur” method

Full JQuery code:

 

“$.browser.msie” is used to detect whether it is IE or not because IE doesn’t support placeholder. So that we apply this to IE alone. But webkit browser like chrome.. always support placeholders.

thanks…

Note:

Please don’t forget to share and subscribe to latest updates of the blog .