How to set jquery global value -
i have select box as
<select id='selectboxid'> <option value="">select id</option> <option value="actor">actor</option> <option value="child artist">child artist</option> <option value="">musician</option> </select>
my jquery code
$(function() { var option = 80; $("#selectboxid").change(function() { option = 17; }); alert(option); })
my requirement when select option option variable value should 17 .please advise how do.
move global variable outside of function
var option = 80; $(function() { $("#selectboxid").change(function() { option = 17; alert(option); }); })
Comments
Post a Comment