Change your document to HTML5 by simply changing the doctype at the beginning of the file to <!doctype html>
.
<!doctype html>
<html>
<!-- head -->
<body>
<input type='text' name='foo' placeholder='foo'>
</body>
</html>
If this is not possible in your project, you can then choose to use Javascript to create the same effect as the attribute placeholder:
<input type='text' value='foo'
onfocus="if (this.value === 'foo') {this.value = '';}"
onblur="if (this.value === '') {this.value = 'foo';}">
The second option gives a little more work, it is not simply checking if the field value is "foo" (which was just an example). In that case, use a plugin that this treatment may be the best solution, for example the Placeholder.js.
What would this validation error be? Is it really necessary to remove the property? It is the most suitable for your proposed goal, semantically speaking.
– Rafael Almeida