Thursday, August 23, 2012

Change document title tag using jQuery

jQuery is awesome and it comes handy when you want to modify the DOM. Here is a small snippet to change the title tag of the document when page is loaded and ready.

/*First load the jQuery library*/
<script type="text/javascript"
/*Now, modify the title tag.*/
<script type="text/javascript">
 jQuery(document).ready(function() {
   jQuery("title").html("Insert your new title here");

There are few other methods too. If you find one share them with your comments below.

No comments:

Post a Comment