Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <body>
- <!-- Roy The Fuckin King Weisfeld-->
- <img id="myImage" onclick="changeImage()" src="pic_bulboff.gif" width="100" height="180">
- <p>Click the light bulb to turn on/off the light.</p>
- <p>Write something in the text field to trigger a function.</p>
- <input type="text" id="myInput" oninput="myFunction()">
- <p id="demo2"></p>
- <script>
- function myFunction() {
- var x = document.getElementById("myInput").value;
- document.getElementById("demo2").innerHTML = "You fucking wrote: " + x;
- }
- function changeImage() {
- var image = document.getElementById('myImage');
- if (image.src.match("bulbon")) {
- image.src = "images/bulboff.gif";
- } else {
- image.src = "images/bulbon.gif";
- }
- }
- </script>
- <p id="demo">JavaScript can change HTML content.</p>
- <button type="button" onclick='document.getElementById("demo").innerHTML = "I Double Dare You MotherFucker!"'>Click Me! I Dare You</button>
- <p id="demo3">JavaScript can change the style of an HTML element.</p>
- <button type="button" onclick="document.getElementById('demo3').style.fontSize='35px'">Click Me!</button>
- <!-- Roy The Fuckin King Weisfeld-->
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement