You can use the indexOf() method to find a substring or string within another string. This method returns the index or position of the first occurrence of a specified string within a string. Similarly, you can use the lastIndexOf() method to get the index or position of the last occurrence of the specified string within
Escape sequences are also useful for situations where you want to use characters that can’t be typed using a keyboard. Here are some other most commonly used escape sequences. \n is replaced by the newline character \t is replaced by the tab character \r is replaced by the carriage-return character \b is replaced by the
A string is a sequence of letters, numbers, special characters and arithmetic values or combination of all. Strings can be created by enclosing the string literal (i.e. string characters) either within single quotes (‘) or double quotes (“), as shown in the example below: You can use quotes inside a string, as long as they
A mouse event is triggered when the user click some element, move the mouse pointer over an element, etc. Here’re some most important mouse events and their event handler. The Click Event (onclick) The click event occurs when a user clicks on an element on a web page. Often, these are form elements and links.
An event is something that happens when user interact with the web page, such as when he clicked a link or button, entered text into an input box or text area, made selection in a select box, pressed key on the keyboard, moved the mouse pointer, submits a form, etc. In some cases, the Browser