<!doctype html>
<html>
<head>
<meta charset=utf-8 />
<title>html5 获取input内容</title>
</head>
<body>
<input type="email" />
<input type="tel" />
<input type="range" />
<input type="url" />
<input type="number" />
<input type="tel" />
<input type="date" />
<input type="datetime" />
<ol id="debug"></ol>
<script>var d = document.getelementbyid('debug');
[].foreach.call(document.queryselectorall('input'), function (el) {
d.innerhtml += '<li>' + el.type;
d.innerhtml += el.getattribute('type') + '</li>';
});
</script>
</body>
</html>
本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!