Is there any way to apply CSS classes based on HTML element's property (not based on element's attribute) without using JavaScript?
For example, consider below input element:
<input type="text" id="txtName" class="form-field__input" name="txtName" value="">
When user interacts with above element and enters some text, its "value" property gets updated; but "value" attribute remains empty. By any means can we access element's property inside CSS ? I know it is possible to update "value" attribute using JavaScript, and then using attribute selectors update the styles; but is there any way to achieve this using CSS selectors only ?
To clarify, I am not concerned about whether the input is valid or not, I just want to check availability of content, and if the content is present then "any-css-rule-1" should get applied, otherwise "any-css-rule-2".