Changing the “placeholder” attribute of HTML5 input elements dynamically using Javascript
问题 I'm trying to dynamically update the HTML5 placeholder attribute of a text field using jQuery. $("textarea").attr("placeholder", "New placeholder text"); From Firebug, I can observe that the placeholder attribute is indeed changing. But in the rendered textarea element, it stays the same. Any suggestions? 回答1: If you are using Firebug I can assume you are using Firefox, and Firefox doesn't yet support placeholder attribute in the input fields itself. Placeholder feature detection I just tried