onclick location href | Open HTML pages/website on a button click

If you want to open these HTML pages on a button click use onclick location href. onclick Attribute Input tag onclick location href Example HTML code: Output: OR Button html href Do comment if you have any doubts and suggestions on this HTML/JS tutoiral. RohitDegree in Computer Science and Engineer: App Developer and has multiple Read More…


Button with href | Adding Href to Button example code

If JavaScript is allowed, set the window.location.href to create Button with href. Instead of <input type=”button”> in above example, you can also use <button>. The only difference is that the <button> element allows children. The plain HTML way is to put it in a <form> wherein you specify the desired target URL in the action Read More…



HTML a href call JavaScript function | Example code

You can use href or on click method to call a JavaScript function from HTML elements. A href call function : href HTML a href call JavaScript function example Simple addition function will call on clicking the link, where function will call from href attribute. In the example we are doing call JavaScript function from Read More…



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…