📜 ⬆️ ⬇️

Cross-browser placeholder + fix for Chrome

Background:


The day started today is not very successful ... The bosses began to rally the brain about the unusual behavior of the Chrome browser regarding the placeholder attribute (the clue does not disappear when the focus appears on the element)

It is a lot of sites, desires something to alter a little.

As a result of this combination of factors, a modified jQuery plugin appeared - powerful-placeholder, which adds placeholder support to older browsers + in Chrome when the focus appears on the element hides placeholder.

Plugin: github.com/evgentus/powerful-placeholder
')

Using:


$(document).ready(function(){ $.Placeholder.init({ color : "#aaa" }); }); 


Perhaps this problem can be fixed faster and more beautifully. But, honestly, I searched and did not find it.

I hope someone will come in handy.

UPD: Added uncompressed version + fixed some moments ...

Source: https://habr.com/ru/post/150920/


All Articles