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,240
Replies
3
Views
2,215
Replies
5
Views
4,852
SIG
Replies
2
Views
1,982
Newer threads
Replies
4
Views
2,463
Replies
9
Views
6,432
Replies
4
Views
4,447
Replies
3
Views
17,021
Recommended threads
Replies
3
Views
8,086
Replies
1
Views
5,840
Replies
9
Views
5,346
Top