jquery manipulation Controls

Source: Internet
Author: User

Add foreground control to the project radio, the operation of two div display and hide, is actually a very simple problem, but the cost of the boss to complete, that is, jquery operation control of some basic knowledge. There are three kinds of methods, briefly introduced:

  

1. Set the style property for the element:

$ ("#divShareExamPage"). attr ("style""display : none; " ); $ ("#divExamPage"). attr ("style" ) " Display:block; ");

2. Change the CSS style of the control via jquery:

$ ("#divShareExamPage"). CSS ("display""None"  "); $ ("#divExamPage"). CSS ("display  "block");

3, through the jquery own show (), Hide () method:

$ ("#divExamPage"). Show (); $ ("#divShareExamPage") . Hide ();

  

To manipulate the foreground control radio:

&LT;TD align =" Right"> <input type="Radio"Id="radioteachercreate"Value ="Personal Test Paper"Name ="Exampage" checked="checked"onclick ="Clickradio ()"/>Personal Test Paper<input type="Radio"Id="Radioshare"Value ="Share Quiz"Name ="Exampage"onclick ="Clickradio ()"/>Share Quiz<input type="Radio"Id="Radiosystem"Value ="System Papers"Name ="Exampage"onclick ="Clickradio ()"/>System Papers</td>

Extract the value values in the radio:

var radiovalue = $ ("input[name= ' exampage ']:checked"). Val ();

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.