form表单小特性

form表单特点

特点1

在form表单中.button标签不设置type=“button”,那么默认是type=“submit”

下面展示一些 内联代码片

点击后按钮后,就提交了
// An highlighted block
<form action="/abc?i=1" method="post">
		<button>在form中button按纽不加入type="button",默认是submit</button>
</form>

在这里插入图片描述

特点2

form属性 action="/路径?k=v" ,如果想要带上action中的参数,必须使用post方式

下面展示一些 内联代码片

get不行带上参数
// An highlighted block
<form action="/abc?i=1" method="get">
		 <button>在form中button按纽不加入type="button",默认是submit</button>
</form>

在这里插入图片描述

post可以带上参数 
// An highlighted block
<form action="/abc?i=1" method="post">
		 	<button>在form中button按纽不加入type="button",默认是submit</button>
</form>

在这里插入图片描述

特点3

form表单中,有name属性,但无值 ,默认是空字符

下面展示一些 内联代码片

get和post方式进行测试
// An highlighted block
<form action="/abc?i=1" method="get">
		<input type="text" name="username" />
		<button>在form中button按纽不加入type="button",默认是submit</button>
</form>

在这里插入图片描述
get提交

// An highlighted block
<form action="/abc?i=1" method="post">
		<input type="text" name="username" />
		<button>在form中button按纽不加入type="button",默认是submit</button>
</form>

post提交

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值