Giovanni Azua Giovanni Azua - 6 months ago 11
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

PageID
like this:

$("meta[name='PageID']").attr('content')


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

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


but this doesn't work.

Answer

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