🤯 50% Off! 700+ courses, assessments, and books

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');