html5 获取input内容

来源:转载

<!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>




分享给朋友:
您可能感兴趣的文章:
随机阅读: