How do you open a new tab by clicking a button using javascript?
-
Ok, so I'm abit new to javascript and I'm trying to use javascript on my website I'm making. Basically, I want the script to be able to open up a new tab to a different link, i.e facebook.com. But i want the javascript to only run when I click on say a "Go here" button. How would I do that? I've gone through google, but again, i'm new to javascript and have no idea what i'm to change in any of the scripting. So any help would be appreciated greatly.
-
Answer:
Why do you need javascript for this? You can just use formtarget (if using a form button) or target (if using an anchor tag) that is pointed to _new or _blank. If you must use javascript, do: onclick="javascript:window.open('someth… here')" and use whatever url you need instead.
Dark at Yahoo! Answers Visit the source
Related Q & A:
- How to programmatically open a new tab on Safari iPad?Best solution by whoknew.dk
- How to open new JFrame by clicking on button in other JFrame?Best solution by Stack Overflow
- Can I open my bookmarks in a new tab when I am in my yahoo?Best solution by answers.yahoo.com
- How do I open a .doc file using yahoo mail?Best solution by answers.yahoo.com
- How do I open a new email on Yahoo?Best solution by eHow old
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.