Help me with var in javascript?

I have a 1.htm file

<html>
var a=1;

<!---- i want to get var a=1 . but don’t give var a into <script>…</script>---->
<script src=“1.js”></script>
</html>

In 1.js file writed:


alert(a);

I want to call var a from 1.htm file to 1.js
Can everyone help me !
Thanks all very much !!!

You need to put that statement between script tags, then follow that with the inclusion of your other JavaScript file:


<html>
<head>
<script type="text/javascript">
  var a = 1;
</script>
<script src="1.js"></script>
</head>
<body>
...
</body>
</html>