
<!DOCTYPE html>
<html>
<head>
<title>main.html</title>
<meta http-equiv="contentType" content="html/text;charset=utf-8" />
<script type="text/javascript" language="javascript">
function myMethod(){
var a = document.getElementById("1").value;
var b = document.getElementById("2").value;
var c = document.getElementById("3").value;
var p =(parseInt(a) +parseInt(b) +parseInt(c))/2;
var p1= p*(p-a)*(p-b)*(p-c);
var S = Math.sqrt(p1);
document.getElementById("4").value = S;
}
</script>
</head>
<body>
<form>
<input type="text" id="1"/>
<input type="text" id="2"/>
<input type="text" id="3"/>
<input type="button" value="计算三角形面积" onclick="myMethod()"/>
<input type="text" id="4"/>
</form>
</body>
</html>
<html>
<head>
<title>main.html</title>
<meta http-equiv="contentType" content="html/text;charset=utf-8" />
<script type="text/javascript" language="javascript">
function myMethod(){
var a = document.getElementById("1").value;
var b = document.getElementById("2").value;
var c = document.getElementById("3").value;
var p =(parseInt(a) +parseInt(b) +parseInt(c))/2;
var p1= p*(p-a)*(p-b)*(p-c);
var S = Math.sqrt(p1);
document.getElementById("4").value = S;
}
</script>
</head>
<body>
<form>
<input type="text" id="1"/>
<input type="text" id="2"/>
<input type="text" id="3"/>
<input type="button" value="计算三角形面积" onclick="myMethod()"/>
<input type="text" id="4"/>
</form>
</body>
</html>




