js學習-滑鼠經過輸入框顯示提示資訊

來源:互聯網
上載者:User

標籤:style   io   ar   使用   sp   java   for   on   div   

經過輸入框能顯示資訊,一種直接用css的title屬性,title屬效能顯示要提示的資訊,但不宜控制,

學習整理js方法,即如下代碼:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>移動到輸入框提示資訊</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>
  </head>
  <body>
    <form>
      <div id="ch">
        <label><input type="checkbox" />兩周內自動登陸</label>
        <div id="info">不要在網吧,公用地區使用此功能</div>
      </div>
    </form>
  </body>
</html>

js學習-滑鼠經過輸入框顯示提示資訊

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.