Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
textareaでのplaceholder改行したい->ダメでした
<!DOCTYPE html>
<html lang='ja'>
<body>
<!-- ChromeだけOK -->
<textarea id='' name='' cols='30' rows='10' placeholder='ああ&#x000A;あああ'></textarea>
<!-- ダメ -->
<textarea id='' name='' cols='30' rows='10' placeholder="あああ&lt;br&gt;あああ"></textarea>
<!-- ChromeだけOK -->
<textarea id='' name='' cols='30' rows='10' placeholder='ああ
あああ'></textarea>
</body>
</html>
<!--
http://www.w3.org/TR/html5/forms.html#attr-textarea-placeholder には User agents should present this hint to the user when the element's value is the empty string and the control is not focused (e.g. by displaying it inside a blank unfocused control). All U+000D CARRIAGE RETURN U+000A LINE FEED character pairs (CRLF) in the hint, as well as all other "CR" (U+000D) and "LF" (U+000A) characters in the hint, must be treated as line breaks when rendering the hint.
http://www.w3.org/TR/html-markup/textarea.html には placeholder = string without line breaks
と書いてある..
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment