Eclipse HTML: placeholder - not an attribute?

I use the latest version of Eclipse Luna (for Java EE developers), and when I insert <input type='text' placeholder='test123' , eclipse says "Undefined attribute name (placeholder)".

enter image description here Why is that? Did I do something wrong? Is there any way to fix this?

+5
source share
2 answers

Eclipse validates html tags and attributes on doctype. Make sure you give the doctype on top. This will fix the problem. In addition, Eclipse uses IE internally. You can configure it on firefox / chrome to improve tags and compare attributes.

Refer to this How to change external eclipse browser from IE to Firefox in Windows XP? to change your browser.

+9
source

Add a <!DOCTYPE html> , indicating that its HTML5, placeholder is a new element in HTML5 and does not exist on HTML4 or earlier versions

 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> </head> <body> <form> <input placeholder="aspdkpoas"/> </form> </body> </html> 
+9
source

Source: https://habr.com/ru/post/1205466/


All Articles