JS Learning-the mouse through the input box to display the prompt information

Source: Internet
Author: User

Through the input box can display information, a direct use of CSS Title property, the title property can display the information to be prompted, but it is not appropriate to control,

Learn to organize the JS method, that is, the following code:

<! DOCTYPE html>
<meta charset= "Utf-8"/>
<title> move to input box prompt information </title>
<style type= "Text/css" >
#info {background: #ccc; width:120px;padding:5px;border:1px solid #f90; font-size:12px;display:none;}
</style>
<script type= "Text/javascript" >
Window.onload=function ()
{
var iinfo = document.getElementById ("info");
var Ilabel = document.getelementsbytagname ("label") [0];
Ilabel.onmouseover = function ()
{
Iinfo.style.display = "block";
}
Ilabel.onmouseout = function ()
{
Iinfo.style.display = "None";
}
}
</script>
<body>
<form>
<div id= "ch" >
<label><input type= "checkbox"/> Automatic login in two weeks </label>
<div id= "Info" > do not use this feature in Internet cafes, public areas </div>
</div>
</form>
</body>

JS Learning-the mouse through the input box to display the prompt information

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.