Show hidden link or links onclick

0 Luka Roguljic · September 18, 2015
Can someone help me with my problem?

lets say you have index.html, and in index.html you have link1 that you can see when page is loaded.

when you click link1 it opens in new tab, but at same time you click link1 it shows link2(link2 is hiddden at first) on index.html?

is this less confusing


Post a Reply


Oldest  Newest  Rating
0 Jagdeep Matharu · September 19, 2015

try giving more details, :)
0 Bernard Pyc0d333 Parah · September 19, 2015
Im more confused after reading the question
0 Luka Roguljic · September 19, 2015
sorry for bad question,

ill try to make it less confused.
0 Tincu Andrei · September 20, 2015
something like this?

<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<title>show link</title>

<a id="link1" href="" target="_blank">google</a>
<a href="#" id="hidden_link">link2</a>

var link1 = document.getElementById('link1');
var link2 = document.getElementById('hidden_link');
link1.addEventListener('click', function(){ = "inline-block";
  • 1



A scripting language that is added to standard HTML to create interactive effects, apps, games for the browser.