Suppose I have some html file and it's have some script inside it. Then, I need to use another one script and want to use some variable from previous one. How Can I do it? Example:
<body>
<script>
var a = 1;
</script>
<p id="p"></p>
<script>
document.getElementById("p").innerHTML = a;
</script>
</body>
Its says that "a" is undefined.