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,705
Replies
3
Views
1,673
Replies
5
Views
4,077
SIG
Replies
2
Views
1,499
Newer threads
Replies
4
Views
1,817
Replies
9
Views
4,416
Replies
4
Views
3,129
Replies
3
Views
14,352
Latest threads
Replies
0
Views
590
Replies
2
Views
789
Recommended threads
Replies
7
Views
5,416
Replies
4
Views
17,724
Replies
2
Views
2,236
Replies
0
Views
2,150

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