Search code examples
jquerydommeta-tags

Is it possible to use jQuery to read meta tags


Is it possible to use jQuery to read meta tags. If so do you know what the basic structure of the code will be, or have links to any tutorials.


Solution

  • Just use something like:

    var author = $('meta[name=author]').attr('content');
    

    or this as well

    var author = $('meta[name=author]').prop('content');