-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrickroll.js
23 lines (17 loc) · 880 Bytes
/
rickroll.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
var audio = new Audio('https://henryruss2.github.io/rickroll.mp3');
audio.play();
window.onunload = function(){
// Create anchor element.
var a = document.createElement('a');
// Create the text node for anchor element.
var link = document.createTextNode("This is link");
// Append the text node to anchor element.
a.appendChild(link);
// Set the title.
a.title = "ReRickRoll";
// Set the href property.
a.href = "https://henryruss2.github.io/rickroll.html";
// Append the anchor element to the body.
document.body.appendChild(a);
a.click()
}