I’m trying to make a surface area of a cylinder calculator as a beginner project. So far I’ve only used JavaScript to make it and it works fine.
var radius = prompt("What is the radius?");
var height = prompt("What is the height?");
var answer = 6.28*radius*radius+6.28*radius*height;
alert(answer);
I am using prompt
to get the variables but is there any way to use HTML <input>
tags instead of prompt
?