Advertisement
Guest User

Untitled

a guest
Oct 16th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <script>
  3. function licz()
  4. {
  5. var wynik = document.createElement("div");
  6. var zapelniacz = document.createElement("div");
  7. var dzialanie = document.getElementById('io').value+'='+eval(document.getElementById('io').value);
  8. wynik.innerHTML = dzialanie;
  9. wynik.style.width='auto';
  10. zapelniacz.className='lol';
  11. document.body.appendChild(wynik);
  12. document.body.appendChild(zapelniacz);
  13. //document.getElementById('wynik').innerHTML+='<br>'+document.getElementById('io').value+'='+eval(document.getElementById('io').value);
  14. }
  15. </script>
  16. <html lang="pl">
  17. <head>
  18. <meta charset="utf-8">
  19. <title>Zadanie 7</title>
  20. <style>
  21. h1 {color:red; margin-left:50px; font-variant:small-caps;}
  22. div {background-color:lightblue; border:2px solid black; display: inline-block;}
  23. .lol {display:block; border: none; width: 100px;}
  24. </style>
  25. </head>
  26. <body>
  27. <h1>Kalkulator</h1>
  28. <input id="io">
  29. <button onclick="location=location">Wyczyść</button>
  30. <button onclick="licz();">licz</button>
  31. <br>
  32.  
  33.  
  34. </body>
  35. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement