您现在的位置: 万盛学电脑网 >> 程序编程 >> 网页制作 >> Html5 >> 正文

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内容的方法的精彩内容就先到这里。更多精彩内容,还请大家持续关注精品。

相关推荐:

HTML5embed标签使用方法介绍