Skip to content

Instantly share code, notes, and snippets.

@Mcbeany
Created January 5, 2022 02:42
Show Gist options
  • Save Mcbeany/6b591bc1e8c17c522088c6d85ff87f52 to your computer and use it in GitHub Desktop.
Save Mcbeany/6b591bc1e8c17c522088c6d85ff87f52 to your computer and use it in GitHub Desktop.
rickroll people using html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
#rick {
display: none;
}
</style>
<script>
function playRick() {
const rick = document.getElementById('rick'); // get element
rick.style.display = 'block'; // unhide video
rick.requestFullscreen(); // enter full screen mode
rick.setAttribute('src', rick.getAttribute('src') + '?autoplay=1'); // autoplay video
}
</script>
</head>
<body>
<iframe id="rick" src="https://www.youtube.com/embed/dQw4w9WgXcQ" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<button onclick="playRick();">Click Me</button>
</body>
</html>
@xDidntPot
Copy link

W

@Mcbeany
Copy link
Author

Mcbeany commented Feb 14, 2022

X

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment