Giovanni Azua Giovanni Azua - 1 year ago 75
Javascript Question

JQuery how to get the content of a meta value that can have two different names?

Using JQuery I can get the contents of a meta with name

like this:


How about when the name can have two different values e.g.
then I'd like to do:

$("meta[name='PageID1' || name='PageId2']").attr('content')

but this doesn't work.

Answer Source

You can select it like this: $("meta[name='PageID1'],meta[name='PageId2']").attr('content')

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download