问题
I have a problem with placeholders in IE 11 even though it says in compatibility table that IE 11 can show placeholders. I am not talking about focus on input. There are no placeholders also when I am not focused on input box.
IE Version: 11.0.9600
I have no css applied on the placeholders.
In other browsers placeholder is showing.
I tried also compatibility using meta tags, no change.
<input id="textinput" name="name" type="text" placeholder="Name" class="form-control input-md" /></input>
回答1:
Okay folks, I just discovered that my lovely company has installed IE 11 but with forced IE 8 view - my god.
- Nevertheless, I solved the problem with this jQuery script, now it is working. https://codepen.io/engza/pen/DptoH
whole code in the link
$(function(){$("input, textarea").placeholder()
回答2:
I just answered this on another Stackoverflow question but maybe I can help people in this question too.
I had the same problem and found out that it was the setting of my CSS framework (Foundation) that put a height of 2.4375rem to all inputs... You need to override that! With something like
[type=color],
[type=date],
[type=datetime-local],
[type=datetime],
[type=email],
[type=month],
[type=number],
[type=password],
[type=search],
[type=tel],
[type=text],
[type=time],
[type=url],
[type=week],
textarea {
height: auto;
}
回答3:
IE 11 will not display the placeholder if you focus on the input using JavaScript or normal User Interaction.
来源:https://stackoverflow.com/questions/42582610/placeholder-internet-explorer-11-not-showing