JavaScript
Article
By Sam Deering

jQuery Get Current Page Title

By 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.

--ADVERTISEMENT--

Another way suggested by Andy.

var current_href = $(location).attr('href');
var current_title = $(document).attr('title');
Recommended
Sponsors
The most important and interesting stories in tech. Straight to your inbox, daily. Get Versioning.
Login or Create Account to Comment
Login Create Account