You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
384 B
JavaScript
11 lines
384 B
JavaScript
5 years ago
|
function volume_sphere()
|
||
|
{
|
||
|
var volume;
|
||
|
var radius = document.getElementById('radius').value;
|
||
|
radius = Math.abs(radius);
|
||
|
volume = (4/3) * Math.PI * Math.pow(radius, 3);
|
||
|
volume = volume.toFixed(4);
|
||
|
document.getElementById('volume').value = volume;
|
||
|
return false;
|
||
|
}
|
||
|
window.onload = document.getElementById('MyForm').onsubmit = volume_sphere;
|