javascript - Checking if a Variable has been assigned an Element or a String -


i building small library involves object manipulation, , there input might assigned id of element (which use document.getelementbyid), or document.getelementby... , whatever goes here.

does know how determine if string or html element

typeof should work:

typeof variable == "string" 

Comments

Popular posts from this blog

How can I edit my VIM config so that Vim treats ".ejs" files the same as it currently treats my html files? -

Python __call__ special method practical example -