Dinesh
Dinesh

Reputation: 29

javascript in radio button

I am newbie in javascript. i have one textBox and radioButton. if i click on the textBox the radioButton should be clicked. Any example for this?

Upvotes: 0

Views: 91

Answers (1)

Marginean Vlad
Marginean Vlad

Reputation: 329

This should do the work :

<html>
<head>
<script type="text/javascript">
function boo()
{
 document.all.myRadioButton1.checked = true;

}
</script>
</head>
<body>
<input type="text" value="some text" onclick="boo()">
<input type="radio" id="myRadioButton1">
</body>
</html> 

Upvotes: 2

Related Questions