I tried searching but didnt get a valid answer to my question. I always get \"null\" when I call document.getElementById(\"#\"+id) and it alerts Document
document.getElementById(\"#\"+id)
Document
document.getElementById() does not need the pound (#) symbol.
document.getElementById()
While you're using JavaScript, you don't use # sign to reference the ID of the element.
#
Your code for
alert("#"+id);
Would be
alert(id);
You need # Number sign, only when working with CSS or jQuery.