HTML Title:
Hello, Mr-S.R Lee< /title> JavaScript:
< ;script type="text/javascript">
function scroll() {
//Get title information.
var titleInfo = document.title;
//Get the first Chinese character (number, letter) of title.
//Note: The index of the first character in the string is 0. If the parameter index is not between 0 and string.length, this method returns an empty string.
var firstInfo = titleInfo.charAt(0);
//Get the second to last information.
var lastInfo = titleInfo.substring(1, titleInfo.length);
//Splicing output information
document.title = lastInfo firstInfo;
}
//Use setInterval() method to execute
setInterval("scroll()", 500);
Full demo code:
]