[jquery form UI selector and form element property selector] Form UI selector and form element property Selector

Source: Internet
Author: User
Tags button type

Form UI selector and form element Property selector:

Instance:

<! DOCTYPE html>;} Html{font:15px/1.2em ' Courier New '; color: #333;}#demo {width:850px;height:350px;margin:20px auto;} #form {width:100%;} Label{display:block;font:15px/1.2em ' Courier New '; color: #333; margin-top:5px;margin-bottom:5px;} INPUT{BORDER:1PX Solid #999;} Input[type= ' text '],input[type= ' password ']{width:100%;height:20px;height:30px;text-indent:5px;color: #000; font:400 15px/    1.2em ' Courier New ';} input[type= ' checkbox ']{width:15px;height:15px;margin:3px 10px;border:1px solid #000; background: #FFF;p adding:0; Color: #FFF; cursor:pointer;}/*form-compatible styles are temporarily unresolved*/Input[type= ' Radio ']{margin:3px 10px;cursor:pointer;} label[ for= ' Famale '],label[ for= ' Male ']{float: left;margin-top:0;} Input[type= ' Submit '],input[type= ' reset '],button{width:100%;height:30px;font:400 15px/30px ' Courier New '; outline:none;margin    : 5px 0;background: #CCC;p adding:0;border:0;transition:.5s all;border-radius:2px;} Input[type= ' Submit ']:hover,input[type= ' reset ']:hover,button:hover{background: #9E9C32; color: #FFF;}</style><script type= ' Text/javascript ' >    $(function(){                //matches all input, textarea, select, and button elements including hidden elementsConsole.log ($ (': input ')). Size ()); //": Text": Matches all single-line text boxes (can be preceded by a limit range)Console.log ($ (' #form input:text '). Get (0). Placeholder); //":p Assword": Matches all Password boxes (can be preceded by a limit range)Console.log ($ (' #form Input:password '). Get (0). Placeholder); //": checkbox": Matches all multi-marquee (can be preceded by a limit range)$ (' #form input:checkbox '). each (function() {Console.log ($ ( This). Val ());                }); //": Radio": Matches all the radio boxes (can be preceded by a limit range)$ (' #form input:radio '). each (function() {Console.log ($ ( This). Val ());                }); //": Hidden": Matches all hidden boxes (can be preceded by a limit range)$ (' #form Input:hidden '). each (function(Index) {console.log ($ ( This). attr (' id '));                }); //": Submit": Matches all the submit buttons (which can be preceded by a limit range)Console.log ($ (' #form input:submit '). Val ()); //": Reset": Matches all the submit buttons (which can be preceded by a limit range)Console.log ($ (' #form input:reset '). Val ()); //": Button": Matches all the commit buttons (which can be preceded by a limit range)Console.log ($ (' #form Button:button '). attr (' type '))); /*and the rest: File:image don't do more demos here.*/              //Match available elements (can be preceded by a limit range)Console.log ($ (' #form button:enabled '). Size ()); //match an unavailable element (can be preceded by a limit range)Console.log ($ (' #form:d isabled '). Size ()); //matches all selected selected elements (Checkboxes, radio boxes, and so on, excluding option in Select) (Can be preceded by a limit range)Console.log ($ (' #form: Checked '). Size ()); });</script> for= ' Famale ' ><input type= ' radio ' value= ' famale ' name= ' sex ' id= ' famale ' checked= ' checked '/>famale</label > <label for= ' Male ' ><input type= ' radio ' value= ' male ' name= ' sex '/>male</label> <input type= ' hidden ' id= ' hi Dden01 ' name= ' demo ' value= ' demo example of form pseudo class selector in jquery ' > <input type= ' hidden ' ID = ' hidden02 ' name= ' demo ' value= ' demo example of form pseudo class selector in jquery ' > <input type= ' Submit ' value= ' submit '/><input type= ' reset ' value= ' reset '/><button type= ' button ' >button</button> & Lt;/form> </div></body>

[jquery form UI selector and form element property selector] Form UI selector and form element property Selector

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.