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,487
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,581
Replies
3
Views
1,526
Replies
5
Views
3,903
SIG
Replies
2
Views
1,382
Newer threads
Replies
4
Views
1,660
Replies
9
Views
3,953
Replies
4
Views
2,773
Replies
3
Views
13,100
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