Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <head>
- <title>Kalkulator</title>
- <meta charset="utf-8">
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
- <script type="text/javascript">
- $(document).ready(function(){
- $('#policz').on('click', function(){
- var liczba = $('#liczba').val();
- var wynik = Math.ceil((liczba/0.7) * 2);
- if(wynik % 2 === 0 ){
- $('#wynik').val(wynik);
- }else{
- wynik++;
- $('#wynik').val(wynik);
- }
- });
- });
- </script>
- </head>
- <body>
- <h1>kalkulator</h1>
- <input type="text" id="liczba">
- <input type="text" id="wynik">
- <button id="policz">Policz</button>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement