Jump to content
  • Hello visitors, welcome to the Hacker World Forum!

    Red Team 1949  (formerly CHT Attack and Defense Team) In this rapidly changing Internet era, we maintain our original intention and create the best community to jointly exchange network technologies. You can obtain hacker attack and defense skills and knowledge in the forum, or you can join our Telegram communication group to discuss and communicate in real time. All kinds of advertisements are prohibited in the forum. Please register as a registered user to check our usage and privacy policy. Thank you for your cooperation.

    TheHackerWorld Official

HTML5-表单的应用、隐藏域、只读、禁用、增强鼠标可用性(点击文字就能选中文本框)

 Share


NedK7

Recommended Posts

表单应用:
隐藏域:hidden
只读:readonly
禁用:disabled
 

 

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>登录注册</title>
</head>
<body>
    
  <h1>注册</h1>
  
    
    <!-- 
    readonly:只读
    当在input中设置了readonly,那这个文本框不能输入值了,只能显示value中的值
    -->
<p>
  文本:
  <input type="text"  value="amde" readonly/>
  </p>
  <!--
    checked:默认值
        disabled:禁用,当设置了个这个,那设置了这个值的文本框,就不能再选中了
    -->
  
     <input type="radio" value="boy" name="sa" checked disabled/><input type="radio" value="girl" name="sa"/><!--
    隐藏域:
        hidden:隐藏域
        作用:我们可以通过隐藏域,来设置默认值,比如:我设置密码的默认值只能为12345,别人无法去修改,那就可以用到这个
    
    -->
    <p>密码
    <input type="passwod" value="12345" hidden/> 
    
    </p>
  
  <!--增强鼠标可用性
    for:放进去的是文本框的id属性
 注:一个label标签只能对应一个文本框属性

    -->
  <label for="yg">
    <p>文本:
    <input type="text" id="yg" /> 
    </p></label>
  
  
    <!--
    submit:提交按钮
    reset:清空按钮
    -->
    <p>
    <input type="submit"/> 
    <input type="reset"/>
    </p>
  
    
  </form>
  
</body>
</html>
Link to post
Link to comment
Share on other sites

 Share

discussion group

discussion group

    You don't have permission to chat.
    • Recently Browsing   0 members

      • No registered users viewing this page.
    ×
    ×
    • Create New...