萬盛學電腦網

 萬盛學電腦網 >> 網絡編程 >> 安卓開發 >> html5 獲取input內容的方法

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>

以上就是我們給大家介紹的html5 獲取input內容的方法了。希望大家繼續關注我們的網站!

 

copyright © 萬盛學電腦網 all rights reserved