您现在的位置: 万盛学电脑网 >> 程序编程 >> 网络编程 >> 安卓开发 >> 正文

html5 获取input内容的方法

作者:佚名    责任编辑:admin    更新时间:2022-06-22

 下面我们给大家介绍一下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>

以上就是我们给大家介绍的html5 获取input内容的方法了。希望大家继续关注我们的网站!