Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <style>
- .block {
- display: inline-block;
- width: 450px;
- height: 450px;
- margin: 10px;
- border: 3px solid black;
- background-color: blue;
- cursor: pointer;
- }
- .is-changed {
- background: black;
- width: 400px;
- height: 400px;
- }
- </style>
- </head>
- <body>
- <div id="vanishingBlock" class="block" onclick="change(this)"></div>
- <div id="cssChangingBlock" class="block" onclick="change(this)"></div>
- <script type="text/javascript">
- function change(element) {
- document.getElementById('cssChangingBlock').classList.add('is-changed');
- element.style.display = "none";
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement