Damn if I can get this.
I have a function in javascript that accepts a string containing the radio button group name, a boolean (the intended checked property value of the radio button) and an integer that points to the button in the group.
function ChangeHTML(id, val, radio)
{
// var HTMLElement = document.getElementById(id[radio]);
// HTMLElement.checked = val;
// var HTMLElement = document.getElementByTagName(id);
// HTMLElement[radio].checked = val;
// var HTMLElement = document.getElementByTagName(id);
// HTMLElement[radio].checked = val;
}
I’ve tried the above three statements and none of them seem to work.
The following works fine with checkboxes btw:
var HTMLElement = document.getElementById(id);
HTMLElement.checked = val;
Anyone care to help me out?