Click here to Skip to main content
15,446,510 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have 10-15 tables in a page and all those tables need to be displayed on click of separate yes/no radio buttons. plz tell me how to do it

What I have tried:

i have used jquery but all works on one table only i need separate for all tables
Posted
Updated 17-Aug-16 1:51am
Comments
Karthik_Mahalingam 17-Aug-16 4:49am    
post the code.

1 solution

You have to find the table over the current radio button like

$(".radio_buttons").click(function(){

// please replace the parent_class with the class name of the parent element, thet is
// parent for the radio_button and the table wich will be controled of clicking.
$(this).parents(".parent_class").finds(".table_class").hide();

});


Example HTML


<input type="radio" class="radio_buttons" />




HTML
<div class="parent_class">
<input type="radio" class="radio_buttons" />
<table class="table_class">
</table>
</div>



HTML
<div class="parent_class">
<input type="radio" class="radio_buttons" />
<table class="table_class">
</table>
</div>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900