Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2019
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. <script>
  2. function wyznacz() {
  3. var P = document.getElementById("P").value;
  4. var N = document.getElementById("N").value;
  5. var R = document.getElementById("R").value;
  6.  
  7. if(isNaN(P) || isNaN(N) || isNaN(R)){
  8. window.alert("wpisz poprawne dane");
  9. } else {
  10. P = parseFloat(P);
  11. N = parseFloat(N);
  12. R = parseFloat(R);
  13.  
  14. var max = Math.max(P, N, R);
  15.  
  16. document.getElementById("skrypt").innerHTML = "Najwyższa średnia:<br>" + max;
  17. }
  18. }
  19. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement