Javascript code for js to obtain radio and select attributes and control _ javascript skills

Source: Internet
Author: User
No stranger to the linkage menu, but this is the first time I wrote the linkage. The principle is very simple, but it is still a little difficult to achieve the goal: 1. Click "anonymous group" and automatically jump: "Private Group" and "Access Control" group members"
2. Click "public group" to automatically jump to: member type "real-name group"

  

The first is to obtain the click radio event. The jquery library is used to determine the radio after the event is obtained. Then, the radio is checked and then the linkage transformation is performed. The problems encountered are: the events compatible with ie and firefox, and then the selected Attribute of options in select.

Compatible with ie and firefox, var ie = document. all; var nn6 = document. getElementById &! is used &&! Document. all;

Set the selected Attribute of options in select to var t = document. getElementsByName ("select1") [0] [1]; t. setAttribute ("selected", "selected ");

When setting the selected Attribute, document. getElementsByName ("select1"). options is usually used, but firefox reports undefined. Then, an array is used to solve the problem.

The complete code for achieving objective 1 is as follows:
Html

The Code is as follows:


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.