Detect if an input has text in it using CSS — on a page I am visiting and do not control?

You can use the :placeholder-shown pseudo class. Technically a placeholder is required, but you can use a space instead. input:not(:placeholder-shown) { border-color: green; } input:placeholder-shown { border-color: red; } <input placeholder=”Text is required” /> <input placeholder=” ” value=”This one is valid” /> <input placeholder=” ” />