Linked Button?

Jssr15

New member
Joined
Nov 1, 2017
Messages
8
Points
0
I'm sure it's just because I haven't had my coffee yet, but can anyone help me figure out what i'm missing as they do not take me to the url when I clock the button.

<button type="button" class="btn btn-info" onclick="URL">Register</button>
<button type="button" class="btn btn-primary" onclick="URL">Login</button>
<button type="button" class="btn btn-success" onclick"URL">Lotto Opt-In</button>

Thank you,
 

Rob Whisonant

Moderator
Joined
May 24, 2016
Messages
2,489
Points
113
You can't call a URL directly from an onclick. Use it to call javascript to launch the URL. Another easy way to do it is modify the href property. For example.

onclick="location.href='http://sitename.com/index.html'"
 
Older threads
Replies
3
Views
1,720
Replies
3
Views
1,687
Replies
5
Views
4,097
SIG
Replies
2
Views
1,511
Newer threads
Replies
4
Views
1,828
Replies
9
Views
4,464
Replies
4
Views
3,188
Replies
3
Views
14,563
Recommended threads

Referral contests

Referral link for :

Sponsors

Popular tags

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top