I have two function outer is function first() and inner is second(),but when I call second function and calling the value of first function value its showing second function is undefined.How to call alert here any one can help me.Actually my requirement is like that,here is the code
html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div onclick=second() id="second">Click</div>
script
function first(){
var x =1 ;
function second(){
alert(x);
}
}