您现在的位置是:探索 >>正文
html表单代码
探索8人已围观
简介<formaction="dede.php"method="POST"name="name1"></form>nam ...
<form action="dede.php" method="POST" name="name1"></form>
name <!--名字-->
value <!--元素值-->
checked=“checked” <!--默认值-->
maxlength=“6” <!--最多输入几个字符-->
<input type="radio" name="gender" value="男" checked=“checked”/>男
<input type="radio" name="gender" value="女" />女
1.输入表单元素
单选按钮
<input type="radio" name="gender" value="男" />男
<input type="radio" name="gender" value="女" />女
定义复选框
爱好:吃饭 <input type="checkbox" name=“aihao”> 睡觉 <input type="checkbox"> 打豆豆 <input type="checkbox">
2.下拉表单元素
<!--书写格式-->
<select> <option></option> </select>
<!--默认选择项-->
selected="select"3.文本域元素
<textarea></textarea>留言板
4.点击任何元素都能选中单选框
<td><input type="radio" name="xb" value="男" id="nan"><label for="nan"><img src="../imag/man.png"></label> 男
<td><input type="radio" name="xb" value="女" id="nv"><label for="nv"><img src="../imag/nv.png"></label> 女
5.高级表单属性值
表单示范
<form action="">
<ol>
<li>邮箱<input type="email"></li>
<li>链接<input type="url"></li>
<li>日期<input type="date"></li>
<li>时间<input type="time"></li>
<li>数字<input type="number"></li>
<li>数量<input type="tel"></li>
<li>搜索<input type="search"></li>
<li>颜色<input type="color"></li>
<li><input type="submit" value="提交"></li>
</ol>
</form>
表单高级提示
<!--不能为空-->
required="required"
<input type="search" name="" id="" required="required">
<!--提示文本-->
placeholder="pink老师"
/*css*/
input::placeholder { color: blue;}
<!--光标自动选取-->
autofocus="autofocus"
<!--下拉选取输入过的文字-->
autocomplete="on"(默认打开)
/*off*/
<!--上传多个文件-->
multiple="multiple"
<input type="file" name="" id="" multiple="multiple">
Tags:
转载:欢迎各位朋友分享到网络,但转载请说明文章出处“慢热自愈时光网”。http://ioai.5m8k.top/html/11f48899500.html
相关文章
舒尚佳绫
探索舒尚佳绫是达利国际集团旗下丝绸生活品牌,专注于丝巾、家居服、家纺、布艺饰品等丝绸类产品。舒尚佳绫品牌从人本出发,传承丝绸文化,放眼世界,缔造现代丝绸新风尚。舒尚佳绫源于博大精深的丝绸传统文化,同时积极 ...
【探索】
阅读更多中国算力平台“算力超市·中小企业专区”首发上线
探索中新社雄安5月9日电 (赵丹媚 韩冰)由中国通信标准化协会主办、中国信息通信研究院承办的2026普惠算力赋能中小企业发展大会9日在河北雄安新区举办。会上,中国算力平台“算力超市·中小企业专区”首发上线 ...
【探索】
阅读更多“海淘”智能穿戴设备或被植入窃密装置 国家安全部最新提示
探索随着全球物流的快速发展,线上跨境购物(“海淘”)已成为一种热门的消费模式。消费者不用亲自出境,只需点击鼠标,远在海外的心仪商品便能送到家门口。广大消费者在享受“海淘”便利的同时,也要警惕和防范其中暗藏 ...
【探索】
阅读更多