What I want is the radio button fire the onchange event when i set the checked state via the javascript.
<script>
function check()
{
document.getElementById("red").checked=true
}
function uncheck()
{
document.getElementById("red").checked=false
}
function selectionChanged(){
alert("checked");
}
</script>
What color do you prefer?<br>
<input type="radio" name="colors" id="red" onchange="selectionChanged()">Red<br>
<input type="radio" name="colors" id="blue" onclick="selectionChanged()">Blue<br>
<input type="radio" name="colors" id="green">Green
<button type="button" onclick="check()">Check "Red"</button>
<button type="button" onclick="uncheck()">Uncheck "Red"</button>
thanks everyone for the help. This is a snippet for a larger problem. I am using a 3rd party reporting tool (LogiXml). the only option i have is to change the events, since the rest of the javascript is generated by the tool. So some of the options provided wont help me. So in the above example the moment I click on the button a corresponding event in the radio button should fire.