33 lines
605 B
HTML
Executable file
33 lines
605 B
HTML
Executable file
<!DOCTYPE html>
|
|
<html>
|
|
<body>
|
|
|
|
<h2>JavaScript Functions</h2>
|
|
|
|
<p>This example calls a function which performs a calculation, and returns the result:</p>
|
|
|
|
<p id="demo"></p>
|
|
|
|
<script>
|
|
format = parseInt(prompt("Introdueïx el sistema origen (c/f)"));
|
|
value = parseInt(prompt("Introdueïx el valor"));
|
|
num3 = parseInt(prompt("Tercer nombre: "));
|
|
|
|
total = (num1*3600) + (num2*60) + num3 + 1;
|
|
|
|
hora = total%3600;
|
|
alert(hora);
|
|
|
|
minut = (total-(hora*3600))%60;
|
|
|
|
|
|
segon = (total-(hora*3600)-(minut*60));
|
|
|
|
alert(hora + ":" + minut + ":" + segon)
|
|
|
|
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|