I have a function, which has a parameter sCellId passed in. I'm trying to get its element using
var tdElement = document.getElementById(sCellId)
Now I have a null check after it, and I fully expect it to be null sometimes, which is fine (if (tdElement)). However, it seems that when an empty string is passed in, I get an exception instead:
Invalid procedure call or argument.
In the watch, if I add document.getElementById(""), it works fine and gives me null. Adding sCellId to the watch I get an empty string "", and If I add document.getElementById(sCellId) to the watch, it again shows the error.
Here's a snapshot of the watched variables:

Is there something I'm missing here?