troubleshooting Question

button to reset all radio buttons within the parent table tag

Avatar of ChenChen
ChenChenFlag for Afghanistan asked on
JavaScript
8 Comments1 Solution726 ViewsLast Modified:
Hi,
I have some html like this:
<form id="form1" name="form1>
....
....
<table>
<tr><td><input type="radio" name="a"/></td></tr>
<tr><td><input type="radio" name="a"/></td></tr>
...
<tr><td><input type="button" value="reset" onclick="reset(this);"/></td></tr>
<table>
...
...
</form>
I would like the reset function to reset all radio button value within the parent table. The html is just an example, the table structures can be vary. but no matter what structures it is,  I just need to reset all radio values within the table. And I don't want to use getElementById or ByName.
I am thinking to make the javascript function to traverse up to the first <table> tag and traverse down to reset all radio button it finds.
Thanks for your help in advance.


<form id="form1" name="form1>
....
....
<table>
<tr><td><input type="radio" name="a"/></td></tr>
<tr><td><input type="radio" name="a"/></td></tr>
...
<tr><td><input type="button" value="reset" onclick="reset(this);"/></td></tr>
<table>
...
...
</form>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 8 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros