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


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

Other Items in javascript
Page Views

This page has been viewed 45 times.

Search Code
Search Code by entering your search text above.

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
You want to be the best, you MUST put the long yards in! Nothing comes easy in life so stop wishing and start DOING! So many people would rather bitch and moan than help themselves. Dont be one of those negative drainers, start today, make a small change and keep going forwards with this attitude!