Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse HTML: placeholder is not an attribute?

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).".

enter image description here Why is it like that? Have I done something wrong? Is there a way of fixing this?

like image 295
Victor2748 Avatar asked Oct 24 '14 18:10

Victor2748


People also ask

Is placeholder an attribute in HTML?

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.

What is placeholder attribute?

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.

How do you put a placeholder in HTML?

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.

Can we use placeholder in select tag?

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.


2 Answers

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>
like image 184
Henrique dos Santos Goulart Avatar answered Sep 22 '22 22:09

Henrique dos Santos Goulart


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.

like image 21
ashfaq.p Avatar answered Sep 24 '22 22:09

ashfaq.p