Horje
How to create Button as a Link | HTML Links Code
How to create Button as a Link

To use an HTML button as a link, you have to add some JavaScript code.


Full Example of Button as a Link

JavaScript allows you to specify what happens at certain events, such as a click of a button:
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h2>Button as a Links</h2>

<p>Click the button to go to the HTML tutorial.</p>

<button onclick="document.location='https://itupto.com'">HTML Tutorial</button>

</body>
</html>

Output should be:

Full Example of Button as a Link



Read Full::
HTML Links Code
Category:
HTML Code
Sub Category:
HTML Links Code
Uploaded:
7 months ago
Uploaded by:
Admin
Views:
72

Related Articles
What is HTML Links HTML Links Code
How to create HTML Links - Syntax HTML Links Code
How to create HTML Links The target Attribute HTML Links Code
What is Absolute URLs vs. Relative URLs HTML Links Code
How to use an Image as a Link HTML Links Code
How to use Link to an Email Address HTML Links Code
How to create Button as a Link HTML Links Code
How to use a title in Link HTML Links Code

Single Articles
Full Example of Button as a Link

Share on: