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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

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

android - How to create dynamically Fragment pager adapter -