获得所有表单值的JQuery实现代码[IE暂不支持](2)


<html>
<head>
    <script type="text/javascript" src="https://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<div>
<h2>Get All Form Elments Value</h2>
<div>
<form>
    <ul>
        <li>
        <p>Text</p>
        <input type="text" value="" />
        </li>
    <li>
        <p>TextArea</p>
        <textarea value=""></textarea>
    </li>
    <li>
        <p>Single Select</p>
        <select>
            <option>Apple</option>
            <option>Blue</option>
            <option>Mary</option>
            <option>Asia</option>
        </select>
    </li>
    <li>
    <p>Multiple Select</p>
    <select multiple="multiple">
    <option>Flowers</option>
    <option selected="selected">Shrubs</option>
    <option>Trees</option>
    <option selected="selected">Bushes</option>
    <option>Grass</option>
    <option>Dirt</option>
    </select>
    </li>
    <li>
        <p>Check Box</p>
        apple <input type="checkbox" value="apple" />
        banana <input type="checkbox" value="banana" />
        pear <input type="checkbox" value="pear" />
        cherry <input type="checkbox" value="cherry" />
        strawberry <input type="checkbox" value="strawberry" />
    </li>
    <li>
        <p>Radio</p>
        <div>
    <input type="radio" value="orange">
    <label for="orange">orange</label>
        </div>
        <div>
            <input type="radio" value="apple">
            <label for="apple">apple</label>
        </div>
        <div>
            <input type="radio" value="banana">
            <label for="banana">banana</label>
        </div>
    </li>
    <li>&nbsp;&nbsp;&nbsp;</li>
        <li><button>submit</button></li>
    </ul>
</form>
</div>
<span></span>
<div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
</body>
</html>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wdjwgw.html