开发者

Radio button selection and stylize ul via jquery help!

开发者 https://www.devze.com 2023-04-13 08:25 出处:网络
I have the following jsfiddle setup: http://jsfiddle.net/5bFq7/8/ basically I have a ul list and when a user selects a li the previous selected li should have the id active removed and the new selec

I have the following jsfiddle setup:

http://jsfiddle.net/5bFq7/8/

basically I have a ul list and when a user selects a li the previous selected li should have the id active removed and the new selected one should have the id active applied to it. Also there are radio buttons, in the li when a new li is selected the corresponding radio button should be selected.

Please can someone help with this as my jquery is awful!

Than开发者_如何学Pythonks


Your HTML isn't that hot either. ;-) Your radio buttons weren't really radio buttons.

http://jsfiddle.net/chrisvenus/5bFq7/16/

is a working copy of the code in terms of selecting a radio button and highlighting the correct options. Changes include to how selectors were being done, where the click event was (on the li instead of the ul), etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号