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
Post a Comment