implementing function into square calculating formula

im kinda really new to html and programing in general so if someone can help me id be really greatful
how do i implement this code into this formula for calculating area of square

*if (r % 1 != 0 || r < 1) {
p.innerHTML = "<span style='color:#FF0000'>Only whole numbers can be inserted!</span>";
} else {
p.innerHTML = area;
}*



<!DOCTYPE html>
<html>
   <body>
      <p>Click to start .</p>
      <button onclick="myFunction()">Start</button>
      <p id="a"></p>
      <p id="p"></p>
      <p id="v"></p>
      <script>
         function myFunction() {
           
         var a = prompt("Type a.");
         var b = prompt ("Type b.");
         var c= prompt ("Type c");
         
            
         var area= 2*(a*b + a*c + b*c);
         
          document.getElementById("a").innerHTML =
                 "Area of square:"  + area;
         }
      </script>
   </body>
</html>