Here is my code. I don't understand why placeholder not shown in explorer. Please help.
HTML CODE
<form method="post" >
<input type="text" class="field" name="nom" placeholder="Votre Nom">
<input type="text" class="field" name="telephone" placeholder="Téléphone">
<center><input type="submit" id="submit_btn" value="Valider" class="btn_submit"></center>
</form>
If you have an input in your form and placeholder is not showing because a white space at the beginning, this may be caused for you "value" attribute. In case you are using variables to fill the value of an input check that there are no white spaces between the commas and the variables.
Check the "Show user agent shadow DOM" checkbox and reload your page. You should now see the placeholder html output in your dev tools when you view the elements tab. Clicking on the placeholder html will bring up the applied styles for you to view or edit.
The placeholder attribute does not work with the input type Date, so place any value as a placeholder in the input type Date. You can use the onfocus=”(this. type='date') inside the input filed.
Definition and Usage The short hint is displayed in the input field before the user enters a value. Note: The placeholder attribute works with the following input types: text, search, url, tel, email, and password.
try OnFocus rather than using placeholder it will work
<input name="nom" type="text" value="Votre Nom" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;">
Let me know whether it works or not
Make sure you have the right colours set up, and one on focus, and the focus one comes later (for higher specificity). For instance:
input::-webkit-input-placeholder {
color: transparent;
}
input:focus::-webkit-input-placeholder {
color: #888;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With