Mukhlis Saputro February 2016

Open New Tab Link Facebook From Localhost When Button Onclick

I have button link in my web app. I run it from localhost. Source code like this, And I think it normally (No error):

<a href="" style="text-decoration:none;" target="_blank"><input type="button" value="Pembuatan Akun Facebook" class="tombol" style="width:200px !important;"></a>

What I want, when I Click That Button, Browser will open new tab, and connect to facebook page. But what I get, it link to url:

http://localhost/dewata/ (My web app in folder dewata).

enter image description here


Any idea what happens?


Vasfed February 2016

You need full href with protocol for external links, otherwise browser expect a file named '' on your site.

<a href="">...

Post Status

Asked in February 2016
Viewed 2,532 times
Voted 11
Answered 1 times


Leave an answer