I have a text field and an explaining div. Can I make this explaining div have opacity = 0 ONLY when I type something in the text field? Thanks in advance for any help. Here is the HTML code:
<input type='text' name='input' id="searchdevice" class="search-field" placeholder="" autofocus/>
<div id="explain">
Search your device in the text field
</div>
You can do it with just CSS if you set the input as
required
:CSS:
When you type something in the input field, it's "valid" and the
#explain
will have opacity of 0.Browser support for the
:valid
selector: http://caniuse.com/#feat=form-validationDemo: https://jsfiddle.net/2ozh40vp/1/