How Do I Create A Button Which Acts Like A Link?

Started by gunjanjain, July 22, 2019, 01:48:17 AM

gunjanjain

Hello friends,

How Do I Create A Button Which Acts Like A Link?

sinelogixtech

Hi Friends,
The most possible ways are,

1. Using HTML,

<a href="http://goole.com"><button>Go to Google</button></a>

<form action="http://google.com">
    <input type="submit" value="Go to Google" />
</form>

2. Using CSS from bootstrap library,

<a href="http://google.com" class="btn btn-default">Go to Google</a>


3. Using JavaScript,

<input type="button" onclick="location.href='http://google.com';" value="Go to Google" />


<button onclick="location.href='http://www.xyz.com'" type="button">
     www.xyz.com</button>