I have two files screen.html and db_fun.js.
I have declared a variable at just the beginning as follows:
var name = "abc";
<form name = "screen" action = "db_fun.js">
<p> <script>document.write(name);</script> </p>
add this to the head