html5 获取input内容


也想出现在这里?联系我们
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>

特别声明:以上内容(如有图片或视频亦包括在内)为本平台用户上传并发布,本平台仅提供信息存储服务。

开通vip