<input id="input" placeholder="City"> | |
<script> | |
// Make sure that the suggested value is not removed when some JavaScript | |
// removes the placeholder attribute. Also make sure that the placeholder is not | |
// in visible mode at that point. | |
internals.setSuggestedValue(input, 'Springfield'); | |
document.getElementById("input").placeholder = ""; | |
</script> | |
<style> | |
:placeholder-shown { | |
background-color: red; | |
} | |
</style> |