Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <!-- see on kommentaar, kommentaarid kuidagi ei mõjuta veebilehe tööd -->
- <!-- head block -->
- <head>
- <title>Lehe nimetus tab-bar'is</title>
- <!-- Include meta tag to ensure proper rendering and touch zooming -->
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <!-- Include jQuery Mobile stylesheets -->
- <link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
- <!-- Include the jQuery library -->
- <script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
- <!-- Include the jQuery Mobile library -->
- <script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
- </head>
- <!-- stiilide block -->
- <style>
- img{
- width: 100px;
- height: auto;
- }
- </style>
- <!-- body block -->
- <body>
- <h3>Kalkulaator</h3>
- <p>Muutuja a väärtus: <input id="a" type="text"></p>
- <p>Muutuja b väärtus: <input id="b" type="text"></p>
- <p>a+b=<text id="apb"></text></p>
- <p>a-b=<text id="amb"></text></p>
- <p>a*b=<text id="akb"></text></p>
- <p>a/b=<text id="ajb"></text></p>
- <button id="calculate">Calculate!</button>
- </body>
- <script>
- $("#calculate").click(
- function(){
- var a = parseInt($("#a").val());
- var b = parseInt($("#b").val());
- $("#apb").html(a+b);
- $("#amb").html(a-b);
- $("#akb").html(a*b);
- $("#ajb").html(a/b);
- }
- );
- </script>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement