Setup issues for checkboxes and radio in Jquery mobile

Source: Internet
Author: User

Using JS to control the state of radio in the jquery Mobile Web page has never been achieved.

Use $ ("Input[name= ' Radio ']:first"). Prop ("checked", true) when setting checked, the value is not read with. attr ("checked").

Use $ ("Input[name= ' Radio ']:first"). attr ("Checked", true) when setting checked, the page display status changes to two without displaying.

Finally can only put prop and attr are written in inside, only calculate solves the problem.

Of course, the final refresh is also necessary, otherwise it will not update the status.

$ ("Input[name= ' Radio ']:first"). Prop ("checked", true). Checkboxradio (' refresh ');
$ ("Input[name= ' Radio ']:first"). attr ("Checked", true). Checkboxradio (' refresh ');
$ ("Input[name= ' Radio ']:last"). attr ("checked", false). Checkboxradio (' refresh ');
$ ("Input[name= ' Radio ']:last"). Prop ("checked", false). Checkboxradio (' refresh ');

Setup issues for checkboxes and radio in Jquery mobile

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.