Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Zadaca 2</title>
- </head>
- <body>
- <h1 class="someclass" id="someid">Hello there</h1>
- <button onclick="values()">Values</button>
- <p id="showval"></p>
- <script>
- function values(){
- var x = document.getElementsByTagName("h1")[0].getAttribute("id");
- document.getElementById("showval").innerHTML=x;}
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement