Skip to main content

jQuery Get Current Page Title

By Sam Deering

JavaScript

Share:

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

Sam Deering has 15+ years of programming and website development experience. He was a website consultant at Console, ABC News, Flight Centre, Sapient Nitro, and the QLD Government and runs a tech blog with over 1 million views per month. Currently, Sam is the Founder of Crypto News, Australia.

Integromat Tower Ad