06网页前端HTML——Form表单属性

一:

表单是HTML中重要的组成部分,是网页提供的一种交互式操作手段,主要用于采集和提交用户的输入信息。

二:

属性 说明
name 表单名称
method 表单发送方式
action 表单处理程序提交地址
enctype 表单编码方式
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>

<body>
<form method="post" action="index.php">
    文本框:<input type="text" name="s"/><br/><br/>
    密码框:<input type="password" name="ps"/><br/><br/>
    文件框:<input type="file" name="file"><br/><br/>
    复选框:篮球<input type="checkbox">足球<input type="checkbox"><br/><br/>
    <!--要写上name值相等,才能够有单选的效果-->
    单选框:男<input type="radio" name="a">女<input type="radio" name="a"><br/><br/>
    
    普通按钮:<input type="button" value="aaa"><br/><br/>
    <!--发送用户信息-->
    提交按钮:<input type="submit" value="注册"><br/>
    重置按钮:<input type="reset" value="重置"><br/>
    图像框:<input type="image" src="" >
    
    列表框:
         <select>
             <option>上海</option>
             <option>广州</option>
             <option>深圳</option>
         </select>
    文本域:<textarea rows="3" cols="2"><!--cols 控制列-->
          
           
           </textarea>
    文本框:<input type="text" value="请输入" maxlength="5" readonly><!--value默认显示的h值,maxlength控制最大的个数,readonly只读-->
    
    隐藏域:<input type="hidden"><!--无需用户修改的,用户看不到-->
    
</form>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/weixin_41167340/article/details/81316063