<!DOCTYPE HTML>
<body>
<!--选项表单 datalist-->
Webpage: <input type="url" list="url_list" name="link" />
<datalist id="url_list">
<option label="Baidu" value="http://www.baidu.com" />
<option label="Google" value="http://www.google.com" />
<option label="Microsoft" value="http://www.microsoft.com" />
</datalist>
<!-- 数据加密 -->
<form action="demo_form.asp" method="get">
Username: <input type="text" name="usr_name" />
Encryption: <keygen name="security" />
</form>
<!--output-->
<p>使用 output 元素的简易计算器:</p>
<form οnsubmit="return false">
<input id="num_a" /> +
<input id="num_b" /> =
<output id="result" onforminput="resCalc()"></output>
</form>
<script type="text/javascript">
function resCalc()
{
numA=document.getElementById("num_a").value;
numB=document.getElementById("num_b").value;
document.getElementById("result").value=Number(numA)+Number(numB);
}
</script>
</body>
HTML5学习(6) 表单元素
最新推荐文章于 2022-04-10 22:13:24 发布