HTML Title:
Copy Code code as follows:
<title> Hello, MR-S.R lee</title>
Javascript:
Copy Code code as follows:
<script type= "Text/javascript" >
function Scroll () {
Gets the title information.
var titleinfo = Document.title;
Gets the first Chinese character (number, letter) of title.
Note: The subscript for the first character in the string is 0. If the argument index is not between 0 and String.Length, the method returns an empty string.
var firstinfo = Titleinfo.charat (0);
Gets the second to the last message.
var lastinfo = titleinfo.substring (1, titleinfo.length);
Splicing Output Information
Document.title = Lastinfo + firstinfo;
}
Use the SetInterval () method to perform
SetInterval ("Scroll ()", 500);
</script>
Full Demo Code:
<title> Hello, mr-s.r lee</title> <script type= "text/ JavaScript "> function scroll () {//Get title information. var titleinfo = Document.title; Gets the first Chinese character (number, letter) of title. Note: The subscript for the first character in the string is 0. If the argument index is not between 0 and String.Length, the method returns an empty string. var firstinfo = Titleinfo.charat (0); Gets the second to the last message. var lastinfo = titleinfo.substring (1, titleinfo.length); Stitching output Information Document.title = Lastinfo + firstinfo; ///Use SetInterval () method to execute SetInterval ("scroll ()", 500); </script>
[ctrl+a All selected note: If you need to introduce external JS need to refresh to perform]