top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to get attributes of an element using jQuery?

+1 vote
382 views
How to get attributes of an element using jQuery?
posted Aug 3, 2017 by Ranjit Bera

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes
var attributes = document.getElementById('idgoeshere').attributes;

// OR

var attributes = $('#idgoeshere')[0].attributes;
alert(attributes[0].name);
alert(attributes[0].value);
answer Aug 4, 2017 by Manikandan J
...