Open multiple tabs with one link | JavaScript code

For example, we want to open 2 URLs (http://google.com and http://yahoo.com) in a different tab with one link click. You can do it in 2 ways defining in a tag or use JavaScript. But in both cased you have to use a window.open method. Open multiple tabs with one link Examples Here is a basic Read More…



Multiple href in one link example | JS Code

You can’t Multiple href in one link HTML alone, because there’s only a single href attribute. Use the window.open() method in JavaScript: Multiple href in one link In JavaScript Complete example code: In Anchor tag In Script In function call window.open(‘url’). Example code create a multiple link for a single <a href> tag. Output: Do Read More…



Open a link without clicking on it using HTML | Example Code

Use window.open with URL inside the auto trigger script to open a new link without clacking in HTML webpage. Open a link without clicking on it example Alone HTML is not possible to open an link in HTML. You can pass the function into onload attribute of body. Where function will trigger a URL and Read More…



URL Info Access | Accessing a URL via web browser JavaScript

JavaScript provides you with many methods to retrieve and change the current URL, which is displayed in the browser’s address bar. All these methods use the Location object, which is a property of the Window object. You can create a new Location object that has the current URL as follows: Basic URL Structure protocol: Specifies Read More…


JavaScript style background color | HTML Example code

Use backgroundColor property in JavaScript to set a style background color of an HTML element. Change style background color example HTML example code to change background color of elements using JavaScript. Change Webpage body color Output: Change div tag color If you’re using a DIV container with a different background color you will need to Read More…


Replace text with image HTML | Example Using JavaScript

Use regular expression and innerHTML to Replace text with an image in HTML. A regular expression is based on the text want to replace. Example how to replace the text with image html HTML example code of Replace Text with Image using JavaScript (getElementsByClass or getElementsByID ). Steps: Use id for the text element Function Read More…