Placeholder on web browser | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Placeholder on web browser

there is any way to make work the placeholder input attribute on internet explorer?

26th Apr 2017, 11:43 AM
Oscar Muñoz
Oscar Muñoz - avatar
2 Answers
+ 15
Placeholder is an attribute of input type text, email, password and few more. It is used to tell user what and how to enter the data in the field. It might not work on few browser versions of IE, or older browser and there is no alternative for that
26th Apr 2017, 12:22 PM
Sachin Artani
Sachin Artani - avatar
+ 3
You can avoid the html5 'placeholder' attribute, and handle one by yourself... example of implementation process: - put your placeholder text in the 'value' attribute, and style your <input> to a placeholder color/style - write a JS function to handle the 'oninput' event, where you compare the text inside the <input> 'value' attribute to your placeholder text and set/unset the placeholder class previously defined [edit] You can/must improve it by deleting the 'value' content 'onclick' or 'onfocus', and fill it with the placeholder text when content is empty...
26th Apr 2017, 5:24 PM
visph
visph - avatar