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,493
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
2,398
Replies
3
Views
2,391
Replies
5
Views
5,035
SIG
Replies
2
Views
2,156
Newer threads
Replies
4
Views
2,616
Replies
9
Views
7,028
Replies
4
Views
4,894
Replies
3
Views
17,687
Latest threads
Replies
1
Views
71
Replies
1
Views
64
Replies
1
Views
229
Replies
2
Views
127
Top