The href is a property of the window.location object that is used to get the complete URL of the existing web page. You can also use window.location.href to set the URL of the current page.
The innerHTML is a property of document object (DOM) which is used to get or set the content of HTML elements.
The setTimeout method is used to “delay” a function or code execution by specifying the time in milliseconds. This is quite useful in certain situations, for example, redirecting from one website
The substr method is used to get the substring of a given string. The substr method takes two arguments; one is the starting position and the other specifies the length of the returned substring.
The getElementById is a method of document object (DOM). The getElementById takes a parameter, Id of the element (as the name shows “get Element By Id”).