Click On Image To Open New Tab In HTML Page how can i add clickable image to open new tab in html page?
Asked
Active
Viewed 4,121 times
-3
-
1This has been answered many, many, many times before... Please show what you Googled before asking this question and why it didn't help you. – Luke Joshua Park Sep 19 '18 at 04:02
-
can i have any links i searched many times but i didn't find correct ans any where so please give a link which i add code in single.php file in my wordpress. thanks – Jilaan Sep 19 '18 at 04:04
-
What did you find when you searched "open link in new tab in html"? – Luke Joshua Park Sep 19 '18 at 04:05
-
here is example link http://www.modafinilsale.com/nature-wallpapers-widescreen.html open this link to click any image then going to open single page i want to add like this in my site. thanks again – Jilaan Sep 19 '18 at 04:06
-
Yep cool, that isn't what I asked you though. Read my last comment and reply to that. – Luke Joshua Park Sep 19 '18 at 04:08
-
many time i searched so please chek my code in single.php file ID), 'full');$width=$large_image_url[1];$height=$large_image_url[2];?> 'shadow')); ?> how can i add here link to open in other page? – Jilaan Sep 19 '18 at 04:10
-
Cool. Yep. So what have you tried already to achieve that? I think you're misunderstanding what StackOverflow is for. It isn't a code writing service. I suggest you [edit your question](https://stackoverflow.com/posts/52397802/edit) to include the code you've tried. – Luke Joshua Park Sep 19 '18 at 04:12
1 Answers
-4
try this one
https://www.w3schools.com/jsref/met_win_open.asp
<!DOCTYPE html>
<html>
<body>
<p>Click the button to open multiple windows.</p>
<a href onclick="myFunction()"> <img src="smiley.gif" alt="HTML tutorial" style="width:42px;height:42px;border:0">
</a></a>
<script>
function myFunction() {
window.open("http://www.google.com/");
window.open("https://www.w3schools.com/");
}
</script>
</body>
</html>

Jeffrey
- 103
- 9
-
-
-
1Please don't answer questions that show no research effort or are direct duplicates of existing questions on the site. Instead refer the asker to the existing question. Read the [help]. – Luke Joshua Park Sep 19 '18 at 04:15
-
-
1Yep he sure does! He'd be able to get that same help if you just refer him to the duplicate question. The benefit of this is that the site doesn't get bogged down with duplicate and unhelpful questions/answers like this one. – Luke Joshua Park Sep 19 '18 at 04:18
-
Additionally, your solution has unnecessary JavaScript involvement. The best way to do this is with the `target` attribute: `target="_blank"`. – Luke Joshua Park Sep 19 '18 at 04:18
-
@LukeJoshuaPark i am just tying to help. this guy is somewhat beginner. – Jeffrey Sep 19 '18 at 04:23
-
Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/180310/discussion-between-jeffrey-acenas-and-luke-joshua-park). – Jeffrey Sep 19 '18 at 04:24