I cannot figure out what is wrong with my markup, but the placeholder for the text area will not appear. It seems as though it may be covered up with some blank spaces and t
I had the same issue, only using a .pug
file (similar to .jade
). I realized that it was also a space issue, following the end of my closing parentheses. In my example, you need to highlight the text after (placeholder="YOUR MESSAGE")
to see:
BEFORE:
form.form-horizontal(method='POST')
.form-group
textarea.form-control(placeholder="YOUR MESSAGE")
.form-group
button.btn.btn-primary(type='submit') SUBMIT
AFTER:
form.form-horizontal(method='POST')
.form-group
textarea.form-control(placeholder="YOUR MESSAGE")
.form-group
button.btn.btn-primary(type='submit') SUBMIT
Delete all spaces and line breaks between <textarea>
opening and closing </textarea>
tags.
<textarea placeholder="YOUR TEXT"></textarea> ///Correct one
<textarea placeholder="YOUR TEXT"> </textarea> ///Bad one It's treats as a value so browser won't display the Placeholder value
<textarea placeholder="YOUR TEXT">
</textarea> ///Bad one
Between the opening and closing tag in our case textarea tag shouldn't be space or newline character or any text(value).
If there's space, newline character or any text, it's considered as value which overrides placeholder.
**PlaceHolder Appears**
<textarea placeholder="Am Default Message"></textarea>
**PlaceHolder Doesn't Appear**
<textarea placeholder="Am Default Message"> </textarea>
<textarea placeholder="Am Default Message">
</textarea>
<textarea placeholder="Am Default Message">Something</textarea>