If I have two DOM
element like this:
<img id="test1" src="xyz" />
<a id="test2" href="#">Test 2</a>
And I'm selecting them in jQuery like this:
$('#test1')
and $('#test2')
I want to be able to return img
and a
respectively. Using either vanilla Javascript or jQuery, what's the best way to do this?