I would like to get the meta content where pageDetails is my HTML page.
$(pageDetails).find('meta[name="biz-id"]').attr("content")
My HTML code is:
<meta name="biz-id" content="q6aDxTSK7njG7qWB1tSV5g">
Why my returned value is always empty?
<meta> tags always go inside the <head> element, and are typically used to specify character set, page description, keywords, author of the document, and viewport settings. Metadata will not be displayed on the page, but is machine parsable.
Have you already tried
var bizId = $("meta[name='biz-id']").attr("content");
In addition, in your query $(pageDetails).find('meta[name="biz-id"]').attr("content")
it's not clear if you have pageDetails
defined previously. Though this has already been noticed in another answer and the question seems to be resolved, just mentioning it here because of being informed that I shouln't have given this info in the comments below this answer but as comment below the OP.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With