The following code throws an error message in the console and i don't understand this logic, because in my code you can see i have written if statements which should first check if the objects exist.
if (typeof document.getElementById("trbrok0").checked != "undefined") document.getElementById("trbrok0").checked = false;
if (typeof document.getElementById("trbrok1").checked != "undefined") document.getElementById("trbrok1").checked = false;
if (typeof document.getElementById("trbrok2").checked != "undefined") document.getElementById("trbrok2").checked = false;
if (typeof document.getElementById("trbrok3").checked != "undefined") document.getElementById("trbrok3").checked = false;
Like you can see we should first check if the object exists and then try to change the value of "checked" property in the object. But I always get the following error message:
Uncaught TypeError: Cannot read property 'checked' of null
checkedproperty fromnull