jquery - Ruby On Rails : how to show/hide related div of radio buttons is checked -


i trying using jquery, not able proceed. please me.

 radio_button_tag(:radio_btn, 1, true)=> if checked div -- 'abc' show else hide()     <div id= "abc">       "abc executing"     </div>   radio_button_tag(:radio_btn, 0)=> if checked div -- 'xyz' show else hide()    <div id= "xyz">       "xyz executing"    </div> 

basically with:

$("input[type=radio]").change(function(e){ // or whatever selector want    // want $(e.currenttarget) }); 

made simple fiddle demonstrate behavior.

http://jsfiddle.net/cc5twser/2/


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -