views:

100

answers:

2

I want to have my title tag look like this:

My Website - Name of Page

I want to prepend the My Website - part so that I don't have to type it on every new page I make. So the title tag that I actually have on the page would be:

<title>Name of Page</title>

Is this possible?

A: 

Seems others have tried and not been able to do is using jQuery but you can use document.title, http://hancic.info/change-page-title-with-jquery

Jonathan
+4  A: 

I think a jquery script to do it would be:

$(document).ready(function() { 
    document.title = "Your WebSite Name - " + document.title; 
}); 

I would recommend doing this at the page level instead of client side though...

Kelsey
Didn't think it would be this simple, but ok. ;-)
Bob Dylan
2/3 of those lines (the jQuery ones) are unnecessary
Michael Haren
I gave you the accepted answer solely because it made your rep a nicer number ;-).
Bob Dylan
LOL. Thank you :)
Kelsey