How can I display a text box's content when the cursor touches the associated label?

寵の児 提交于 2019-12-13 05:10:11

问题


I have a label and a text box associated with it. I have added some text in the text box which is invisible at first; I want to display the content after the cursor moves on the label.

How can I do this?


回答1:


This is to handle on mouse move in client side javascript.

Use label onmousemove event to trap the event, and set textbox visibility to true. [You can easily write the code for yourself]




回答2:


You can use onmouseover and onmouseout event on the label. If you can use a framework like jQuery you can use the hover function.

See a working demo.



来源:https://stackoverflow.com/questions/2537171/how-can-i-display-a-text-boxs-content-when-the-cursor-touches-the-associated-la

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!