I am using the latest version of Eclipse Luna (for Java EE developers), and when I insert an <input type='text' placeholder='test123'
, eclipse says "Undefined attribute name (placeholder).".
Why is it like that? Have I done something wrong? Is there a way of fixing this?
Definition and UsageThe placeholder attribute specifies a short hint that describes the expected value of a input field / textarea. The short hint is displayed in the field before the user enters a value.
The placeholder attribute specifies a short hint that describes the expected value of an input field (e.g. a sample value or a short description of the expected format). The short hint is displayed in the input field before the user enters a value.
Placeholders are commonplace in forms all over the web, including professional forms, so knowing how to put them in with HTML is important. So putting placeholders in forms in HTML is very simple. You just use the attribute, placeholder and set it equal in single or double quotes to the value that you want it to be.
There is no placeholder attribute in 'select' tag but it can make the placeholder for a 'select' box. There are many ways to create the placeholder for a 'select' box.
Add the <!DOCTYPE html>
indicating that its HTML5, placeholder is a new element in HTML5 and doesn't exists on HTML4 or early versions
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<form>
<input placeholder="aspdkpoas"/>
</form>
</body>
</html>
Eclipse checks for html tags and attributes against the doctype. Make sure that you have given doctype on top. It will fix the problem. Also, Eclipse uses IE internally. You can configure it to firefox/chrome for better tags and attribute comparison.
Refer to this How can I change eclipse's Internal Browser from IE to Firefox on Windows XP? for changing your browser.
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