I was writing a reusable function for checking and unchecking some checkboxes according to button cllicks. But I am unable to pass the "id" param through the function call.
Please help.
Function is called here.Code:function checkorUncheck(id) { if(document.getElementById("id").checked == false) { document.getElementById("id").checked = true; } else { document.getElementById("id").checked = false; } }
checkorUncheck(ABC), checkorUncheck('ABC'),checkorUncheck(''ABC'') everything returns error. Can any one help me.Code:lHtml += "<li><input id='btn17' type='button'value='Select' onmouseup='return checkorUncheck(ABC)' ><input type='checkbox' DISABLED name='ABC' id='ABC' value='YES' class='checkclass' />" + getI18nLabel("LABEL_COUGH") + "</li>";


Reply With Quote


Bookmarks