How can I update the variable value in jQuery? How can I update the variable value as it updates in functions? I checked the scope of variable in jQuery but I did not understand.
<script>
$(document).ready(function(){
var s = 9;
function data()
{
var s = 11;
}
data();
alert(s);
});
</script>
I want 11 in alert for data but I am getting 9. how can I update the value if its updated in functions. please help me out for this.