🤯 60% OFF BLACK FRIDAY SALE 650+ books, courses & coding assessments!

jQuery Get Current Page Title

Sam Deering

jQuery code snippet to get the current web page full title and store it in a variable for use with other scripts. This is the title you see on your browser header.

Current page title: mytitle.

Another way suggested by Andy.

var current_href = $(location).attr('href');
var current_title = $(document).attr('title');