jquery Operations Common HTML controls

Source: Internet
Author: User

Set checkbox check:

true);

All input is not available under Set class:

JQuery ('. Audit-form input '). attr (' disabled ', ' disabled ');

Gets the value of the checkbox:

var t4 = $ ("#checkbox_id4"). attr ("value");

jquery adds HTML elements:

<table></table> <a href= "#" id= "Btn-expertgroup" > Add Expert Group </a> <script type= "Text/javascrip T ">JQuery (function() {JQuery ("#btn-expertgroup"). Click (function(){                varIPT = JQuery ("<tr>" + "<td>-</td>" + "<td><input type= ' text ' Name= ' expertname ' </td> ' + ' <td><input type= ' text ' style= ' width:180px ' name= ' expertjob ' &                    Lt;/td> "+" <td colspan= ' 2 ' ><input type= ' text ' name= ' Expertphone ' </td> " + "<td><input type= ' text ' name= ' Expertremark ' </td>" + "</tr>"); Ipt.appendto (JQuery ( This). Prev ()); return false;        });    }); </script>

Focus and lose focus operations:

<input onfocus= "$ (' #councilMember '). Toggle ()"  
Type= ' text ' name= ' councilmember ' value= ' $! {basevillageinfo.councilmember} '/><div id= ' councilmember ' > Fill in Numbers </div>

Set the value of the drop-down list:

$ (' #annual '). Val ($!{ Basevillageinfo.annual});

Set radio button to select:

true);

Ajax passes all elements in the form form that contain the value of name:

    JQuery (' #a_submit '). Click (function() {                //pass name        $.ajax ({            ' village/save '),            "POST",            Data: $ (' #villageInfo '). Serialize (),            function(Request {                alert ("error");            },            function(data) {                $ (' #${di.id} ' ). Bupdlg (' close ');                Alert (' submit success ');                JQuery (' #village '). Bupgrid (' reload ');}})    ;

jquery operations Common HTML controls

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.