Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有这个代码:
<input id="i" type="text" value="value" /> <div id="u" style="border:solid 1px;width:140px;height:100px"></div> <p>thanks</p>
我想让#u 隐藏,并在我单击#i 时显示。然后当我单击#u 时,它将被隐藏。但是如果我点击#u 什么都没有发生。请你帮助我好吗。多谢
$("#i").focus(function() { //When the user clicks on #i then #u is shown $("#u").show(); }): $("#u").blur(function() { //When the user clicks out of #u then #u is hidden $("#u").hide(); }):