I have a CSS that shows and hides a div
.
But I want this to happen only if this field is filled in, that is, if it is different from empty.
<input type="text" onkeypress="return BuscaDados(event);" onblur="CarregaFornecedor(this.value);" class="form-control" name="FornecedorID" id="idfornecedor" />
It shows this div
:
<div class="col-md-5 div_teste" id="mostrar">
<div class="col-md-12">
<label class="control-label" id="fornecedor"></label>
</div>
<div class="col-md-12">
<label class="control-label" id="nomefornecedor"></label>
</div>
<div class="col-md-12">
<label class="control-label" id="ruafornecedor"></label>
<label class="control-label" id="nfornecedor"></label>
</div>
<div class="col-md-12">
<label class="control-label" id="bairrofornecedor"></label>
<label class="control-label" id="cidadefornecedor"></label>
</div>
</div>
This is CSS:
#mostrar {
display: none;
}
#passarmouse:hover #mostrar {
display: block;
}
.div_teste {
width: 350px;
height: 120px;
background: #ffffff;
position: absolute;
z-index: 100;
top: 30%;
left: 40%;
border: 1px solid;
}