Practical No 4
Practical No 4
Practical No 4
<html>
<body>
alert("Hello javascript");
</script>
</body>
</html>
<html>
<body>
<script type="text/javascript">
var dx=x2-x1;
var dy=y2-y1;
</script>
</body>
</html>
<html>
<head>
<title> scope</title>
<script>
function init()
document.write(global);
show();
function show()
document.write(local);
document.write(global)
</script>
</head>
<body>
<script>
init();
</script>
</body>
</html>
<html>
<head>
<script type="text/javascript">
var x=10;
function show(){
var item="pen";
</script>
</head>
<body>
<script type="text/javascript">
show();
</script>
</body>
</html>
<html>
<head>
<script type="text/javascript">
function add(x, y) {
resultx+y; document.write("addition is: " + result);
document.write("<br/>");
</script>
</head>
<body>
<script type="text/javascript">
add(10, 10);
add(23, 12);
</script>
</body>
</html>
<html>
<head>
<script type="text/javascript">
function welcome()
alert('welcome dear..')
function goodbye()
alert('Bye bye..')
</script>
</head>
</html>
<html>
<head>
<script>
function Logon(){
var userID;
var password;
var valid;
password=prompt('Enter password','');
valid=ValidateLogon(userID, password);
alert('Valid Logon');
else{
alert('Invalid Logon');
var ReturnValue;
ReturnValue = true;
} else{
ReturnValue=false;
return ReturnValue;
</script>
</head>
<body onload="Logon()"></body>
</html>
<html>
<head>
</head>
<body>
<script type="text/javascript">
function areaRect(L,B){
var area=L*B;
return area;
x=areaRect(6,8);
document.write(x);
</script>
</body> </html>