, . , . , html-, . ? , , - . , , .
html-. html- - , ( ) . (, ).
:
<html>
<head>
<title>javascript </title>
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<form name="forma1">
<input type="text" name="t1" size="10"><br><br>
<input type="text" name="t2" size="10"><br><br>
<input type="button" name="button" value="" onClick="areaRectangle();"><br><br>
<input type="text" name="res" size="10">
</form>
</body>
</html>
:
function areaRectangle(){
var a=document.forma1.t1.value;
var b=document.forma1.t2.value;
var s=a*b;
document.forma1.res.value=s;
}
, - forma1, . .. :
function areaRectangle(obj){
var a=obj.t1.value;
var b=obj.t2.value;
var s=a*b;
obj.res.value=s;
}
. , - (obj) . html- :
.......
<input type="button" name="button" value=""
onClick="areaRectangle(forma1);"><br><br>
.......
, . , , .
, : (), - . . , :
function showDesc(obj, n){
obj.desc.value=n;
}
desc - . , , , , . "delete":
function delet(obj){
obj.desc.value=' ';
}
.
. , , , onMouseOver, , - onMouseOut.
, , , .. +.