I have given link for td element as shown below
onclick ="location.href="http://www.example.com"
now its opening in the same tab ,but i want it to open in the new tab ,how to do this
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use
window.open(url, optional_name, optional_argument_string). It will be up to the browser if it uses a tab or a window for this.You would be better off using a real link (
<a href=...) and styling it to fill the cell. Then users can middle-click (or shift-click or whatever) if they want a new tab. (You could also use<a href="..." target="_blank">, which opens in a new tab more often thenwindow.open, but foisting new tabs/windows on visitors isn’t very nice).