html - Is it possible to do change on property of a different element from textbox focus event using CSS? -
i want show tool tip on text box focus
#tooltip { display:none; height:50px; width:50px; background-color:red; } #tb1:focus #tooltip { display:block; }
<input type="text" id="tb1"> <span id="tooltip">enter data</span>
but it's not working !!!
use adjacent selector (+) modify display element property
#tooltip { display:none; height:50px; width:50px; background-color:red; } #tb1:focus + #tooltip { display:block; }
<input type="text" id="tb1"> <span id="tooltip">enter data</span>
Comments
Post a Comment