How do I find the id of an article tag in jquery?

FairyBusiness
FairyBusiness used Ask the Experts™
on
Hi, I need to find the id of the article tag but the id is not the same on every page.

example:       <article id="page_1">

So I thought to try this:

var page = $('#content').find('#:article');

but no luck.  Anyone know how to do this?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2004
Commented:
var page = $('#content').find('article')[0].id;

The above should return the ID of the article tag, I would think.

Author

Commented:
is there a way to 'echo' it back so that I can see what's inside of that variable?
Top Expert 2004

Commented:
It depends on what you want to do with it. If you just want to see what it is saying, you can alert() it. What do you want to do with this ID?

Author

Commented:
yep the alert worked. Thanks!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial