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></title>
- </head>
- <body>
- <div class="box">
- <input id="input" value="0" />
- <button id="up" onclick="counter(3)">*3</button>
- <p>Value <span id="output"></span></p>
- </div>
- <script type="text/javascript">
- function counter(val) {
- var value = document.getElementById('input').value;
- var newValue = parseInt(value, 10) * val;
- document.getElementById('output').innerHTML = newValue;
- return newValue;
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement