I’d like to show the div with id=”showDiv”, but only if the input field with id=”textfield” is empty.
<form action="">
<fieldset>
<input type="text" id="textfield" value="">
</fieldset>
</form>
<div id="showDiv" style="width:50px;height:50px;background-color:#6CF;"></div>
Anyone know a Javascript that can do this?
Try this
Check JSFiddle for the example