如何在html中添加工具提示?

nat*_*iya 4 html css

我有以下代码,但它不起作用,任何人都可以帮助我

<form id="myform" action="#">

  <h3>Registration Form</h3>

  <div id="inputs">

    <!-- username -->
    <label for="username">Username</label>
    <input id="username" title="Must be at least 8 characters."/>
    <br />

    <!-- password -->
    <label for="password">Password</label>
    <input id="password" type="password" title="Make it hard to guess." />
    <br />

    <!-- email -->
    <label for="email">Email</label>
    <input id="email" title="We won't send you any marketing material." />
    <br />

    <!-- message -->
    <label for="body">Message</label>
    <textarea id="body" title="What's on your mind?"></textarea>
    <br />

    <!-- message -->
    <label for="where">Select one</label>
    <select id="where" title="Select one of these options">
      <option>-- first option --</option>
      <option>-- second option --</option>
      <option>-- third option --</option>
    </select>
    <br />
  </div>

  <!-- email -->
  <label>
    I accept the terms and conditions
    <input type="checkbox" id="check" title="Required to proceed" />
  </label>

  <p>
    <button type="button" title="This button won't do anything">
      Proceed
    </button>
  </p>

</form>
Run Code Online (Sandbox Code Playgroud)

Pra*_*een 5

title属性起作用。

您的代码适用于 chrome、FF 以及 IE 9 和 10