Get a var from function of the file .htm

I want to get a variable directly from the function m() of file 1.htm to file 2.htm

File 1.htm writed:
===1.htm====
<html>
<head>
<script>
function m()
{
var a=“Happy New Year”;
alert(a);
}
</script>
</head>
<body onload=“m()”>
</body>
</html>
File 2.htm with the following
<script>
// with var a get from var a of file 1.htm
a=1;
alert(a);
</script>

Can everyone help me ??
Thanks !!

What is the use-case scenario for this application?