im trying to figure out why my if statements aren't being displayed on my website. My first script is working which is displaying the triangles areas, and i would like to try to find out how i can display which triangle is bigger using ifelse statements. this is my first time trying to utilize these and would like some help.
edit: I have fixed my paranthesis on my if statements, but now its displaying them even if theyre not true. how should i go about solving this?
edit2: THANK YOU ALL for the amazing help. i appreciate it, my code is now working!
<script>
var Base1 = parseFloat(prompt("Base1", "100"));
var Height1 = parseFloat(prompt("Height1", "100"));
var Base2 = parseFloat(prompt("Base2", "100"));
var Height2 = parseFloat(prompt("Height2", "100"));
document.write("<p>triangle1's Volume is : "+Base1 * Height1/2+"</p>");
document.write("<p>triangle2's Volume is : "+Base2 * Height2/2+"</p>");
</script>
<script>
if((Base1 * Height1/2) == (Base2 * Height2/2));
{
document.write("<p>the triangles are the same size</p>");
}
if ((Base1 * Height1/2) > (Base2 * Height2/2));
{
document.write("<p>triangle 1 is bigger</p>");
}
if ((Base1 * Height1/2) < (Base2 * Height2/2));
{
document.write("<p>triangle2 is bigger</p>");
}
</script>