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

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -