js change title code example

Example 1: javascript change page title

document.title = "My New Page Title"; //change/set page title in JavaScript

Example 2: change page title js

document.title="New Title";

Example 3: javascript title string

function toTitles(s){ return s.replace(/\w\S*/g, function(t) { return t.charAt(0).toUpperCase() + t.substr(1).toLowerCase(); }); }
var str = toTitles('abraham lincoln'); // Abraham Lincoln

Example 4: change the title in html using

document.title = "My New Page Title";

Example 5: javascript change title

// Changing the website's <title>
document.title = "Test";

Tags:

Css Example