Reputation: 213
If we only know the ID of an element, is it possible to check using javascript or jQuery what kind of an element it is, whether its textarea, div, span or something else?
Upvotes: 1
Views: 131
Reputation: 1491
By using jQuery
:
$("#someid").prop("tagName");
By using JavaScript
:
document.getElementById("someid").tagName;
Upvotes: 7