I have a site which has an element with a specific id. I would like to get the href attribute using jQuery. I am trying to do the following:
alert($("#id").prop('href'));
But it says 'undefined'. I tried setting the timer function as well as using jQuery's delay(), but the result is the same, although I can see that the element is there when the alert pops up. What is the problem?