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:
]
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn