File 1.js
var a=5;
function mahi()
{
alert(window.value); //accessing global variable
}
function mahi()
{
alert(window.value); //accessing global variable
}
File 1.htm
<html>
<head>
<script type="text/javascript" src="1.js"></script>
</head>
<body>
<form>
<input type="button" value="button" onclick="mahi()"/>
</form>
</body>
</html>
<head>
<script type="text/javascript" src="1.js"></script>
</head>
<body>
<form>
<input type="button" value="button" onclick="mahi()"/>
</form>
</body>
</html>
No comments:
Post a Comment