using javascript to open a link in the same window and in a new window or tab

a nice easy way to target _self or _blank when opening a link using javascript

HTML

<p><button onclick="window.open('https://kruxor.com/','_self');" class="btn btn-primary">Open in the Same Window</button></p>
<p><button onclick="window.open('https://kruxor.com/','_blank');" class="btn btn-primary">Open in a new window or tab</button></p>

Other Items in javascript

No Items Found.

Add Comment
Type in a Nick Name here
 
Page Views

This page has been viewed 548 times.

Search Code
Search Code by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code snippits here, mostly for my reference. Also if i find a good site, i usually add it here.

âĪðŸ‘Đ‍ðŸ’ŧðŸ•đ

Random Quote
I believe that success can be measured in the number of uncomfortable conversations you're willing to have.
Unknown