0

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?

1
  • Do you want the radio button to get selected (which is unselected initially) when the textbox is clicked or gets focus?? Commented Mar 22, 2011 at 8:33

1 Answer 1

2

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> 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.