button标签的作用是在网页中显示一个类似按钮的内容,它可以点击,拥有一定的效果。
<input type="button" value="按钮" onclick="alert('qqqqq')">
其中,value代表按钮标签中的内容,可以任意替换;onclick="alert(XXX)",表示在点击按钮后,会出现提示,提示的内容为alert中的内容。
reset标签
代表重置的意思,当点击按钮后,在该网页上输入的内容将会全部清空。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>表单列表</title>
</head>
<body>
<form action="">
<input type="text"><br>
<input type="password">
<input type="button" value="按钮" onclick="alert('qqqqq')">
<input type="reset" value="清空">
</form>
</body>
</html>
submit标签
代表提交,将网页中的内容上传到某个网站的服务器上。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>表单列表</title>
</head>
<body>
<form action="https://www.baidu.com">
<!--把输入的text内容与password内容上传-->
<input type="text" name="user"><br>
<input type="password" name="password">
<input type="button" value="按钮" onclick="alert('qqqqq')">
<input type="submit">
</form>
</body>
</html>