# Watir: How could i click this radio button?

**URL:** <https://www.ruby-forum.com/t/watir-how-could-i-click-this-radio-button/117427>\
**Category:** Ruby\
**Created:** [October 16, 2007, 8:01pm UTC](https://www.ruby-forum.com/t/watir-how-could-i-click-this-radio-button/117427 "2007-10-16T20:01:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![maung](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@maung](https://www.ruby-forum.com/u/maung)\
**Post date:** [October 16, 2007, 8:01pm UTC](https://www.ruby-forum.com/t/watir-how-could-i-click-this-radio-button/117427/1 "2007-10-16T20:01:24Z")

</div>

I have tried several different ways, but didn’t succeed. I have a radio  
button which is written in onfocus javascript. If click on it, there  
should another radio button should show up. This is what html source  
code looks like:

_**&nbsp;Yes  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;No**_

The attached picture is what it looks like after one of the button is  
chosen. Could someone help?

Thanks  
maung

---

<div class="post-metadata">

**Author:** ![maung](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@maung](https://www.ruby-forum.com/u/maung)\
**Post date:** [October 16, 2007, 8:25pm UTC](https://www.ruby-forum.com/t/watir-how-could-i-click-this-radio-button/117427/2 "2007-10-16T20:25:36Z")

</div>

Maung A. wrote:

> I have tried several different ways, but didn’t succeed. I have a radio  
> button which is written in onfocus javascript. If click on it, there  
> should another radio button should show up. This is what html source  
> code looks like:
> 
> _**&nbsp;Yes  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;No**_
> 
> The attached picture is what it looks like after one of the button is  
> chosen. Could someone help?
> 
> Thanks  
> maung

Well, this belongs with the rails questions than a ruby one, but i’ll  
try my best. You could either do an AJAX call to update the page, or  
just use css to hide the radio button and then onclick use css to show  
it. Look at a few different javascrip libraries, MooTools is a good one  
and so is jQuery. Here is a link I found with a google search.

[http://www.practicalwebmaster.com/entries/hiding-and-showing-with-javascript.html](http://www.practicalwebmaster.com/entries/hiding-and-showing-with-javascript.html)

~Jeremy
