表单验证

<form action="" class="am-form">
    <fieldset>
        <legend>H5 原生表单验证</legend><br>
        <div class="am-form-group">
            <label for="doc-vld-name">用户名:</label><br><br>
            <input type="text" id="doc-vld-name" minlength="3" placeholder="输入用户名" class="am-form-field" required/><br><br>
            <label for="doc-vld-name">邮箱:</label><br><br>
            <input type="email" id="doc-vld-name" minlength="3" placeholder="输入用户名" class="am-form-field" required/><br><br>
            <label for="doc-vld-name">网址:</label><br><br>
            <input type="url" id="doc-vld-name" minlength="3" placeholder="输入用户名" class="am-form-field" required/><br><br>
            <label for="doc-vld-name">年龄:</label><br><br>
            <input type="age" id="doc-vld-name" minlength="3" placeholder="输入用户名" class="am-form-field" required/><br><br>
            <label for="doc-vld-name">评论:</label><br><br>
            <input type="pinglun" id="doc-vld-name" minlength="3" placeholder="输入用户名" class="am-form-field" required/><br><br>
        </div>
        <input type="submit">
    </fieldset>
</form>
原文地址:https://www.cnblogs.com/rockyan/p/7997765.html