Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function init()
- {
- var tags = document.getElementsByTagName("h1");
- tags[0].onclick = changeColor;
- }
- function changeColor()
- {
- this.innerHTML = "Please come again...";
- var randColor = "#" + Math.floor(Math.random() * 16777215).toString(16);
- this.style.color = randColor;
- }
- onload = init;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement