文章插图
① 文本输入(text),示例:
<!DOCTYPE html>
<html>
<body>
<form>
First name:<br>
<input type=”text” name=”firstname”>
<br>
Last name:<br>
<input type=”text” name=”lastname”>
</form>
<p>请注意表单本身是不可见的 。</p>
<p>同时请注意文本字段的默认宽度是 20 个字符 。</p>
</body>
</html>
运行结果:
文章插图
② 单选按钮输入(radio),示例:
<!DOCTYPE html>
<html>
<body>
<form>
<input type=”radio” name=”sex” value=http://www.wokk.cn/”male” checked>Male
<br>
<input type=”radio” name=”sex” value=http://www.wokk.cn/”female”>Female
</form>
</body>
</html>
运行结果:
文章插图
文章插图
③ 提交按钮(submit),示例:
<!DOCTYPE html>
<html>
<body>
<form action=”/demo/demo_form.asp”>
First name:<br>
<input type=”text” name=”firstname” value=http://www.wokk.cn/”Mickey”>
<br>
Last name:<br>
<input type=”text” name=”lastname” value=http://www.wokk.cn/”Mouse”>
<br><br>
<input type=”submit” value=http://www.wokk.cn/”Submit”>
</form>
<p>如果您点击提交 , 表单数据会被发送到名为 demo_form.asp 的页面 。</p>
</body>
</html>
运行结果:
文章插图
2、<select>元素
<select>元素定义下拉列表,示例:
<!DOCTYPE html>
<html>
<body>
<form action=”/demo/demo_form.asp”>
<select name=”cars”>
<option value=http://www.wokk.cn/”volvo”>Volvo
<option value=http://www.wokk.cn/”saab”>Saab
<option value=http://www.wokk.cn/”fiat”>Fiat
<option value=http://www.wokk.cn/”audi”>Audi
</select>
<br><br>
<input type=”submit”>
</form>
</body>
</html>
运行结果:
文章插图
3、<fieldset>元素
<fieldset>元素组合表单中的相关数据
<legend>元素为<fieldset>元素定义标题,示例:
<!DOCTYPE html>
<html>
<body>
<form action=”/demo/demo_form.asp”>
<fieldset>
<legend>Personal information:</legend>
First name:<br>
<input type=”text” name=”firstname” value=http://www.wokk.cn/”Mickey”>
<br>
Last name:<br>
<input type=”text” name=”lastname” value=http://www.wokk.cn/”Mouse”>
<br><br>
<input type=”submit” value=http://www.wokk.cn/”Submit”>
</fieldset>
</form>
</body>
</html>
运行结果:
文章插图
以上关于本文的内容,仅作参考!温馨提示:如遇健康、疾病相关的问题,请您及时就医或请专业人士给予相关指导!
「四川龙网」www.sichuanlong.com小编还为您精选了以下内容,希望对您有所帮助:- 华为自带手机管家的安装方法 华为手机助手安装不了
- 鸡的肾肿大是什么引起的 雏鸡肾肿什么原因
- 貉子什么时候取皮 什么时候收貉子皮
- 一头头什么的牛形容词 一头头什么的小牛
- 兔子传染人的病 兔子传染人什么病
- 台式电脑调节亮度的方法 屏幕亮度电脑怎么调快捷键
- ipad屏幕锁定的设置 ipad怎么设置屏幕熄灭时间显示
- 我的世界个人重生点设置指令 我的世界出生点指令代码
- 瞿麦的繁殖方法
- 屈曲花的无土栽培