JavaScript / JQuery variable need to change.. on click. Delete old number add new one -
JavaScript / JQuery variable need to change.. on click. Delete old number add new one -
basically i'm trying random number generated alter random number 1 time clicked on button. cannot figure out how unselect form selected i'm trying how below jquery.
var randomnum1 = math.ceil(math.random(20)*10000); var randomnum2 = math.ceil(math.random(20)*10000); var randomnum3 = math.ceil(math.random(20)*10000); var randomnum4 = math.ceil(math.random(20)*10000); $( "#race-again" ).click(function() { $( ".one" ).css( { marginleft: "0" }); $( ".two" ).css({ marginleft: "0" }); $( ".three" ).css( { marginleft: "0" }); $( ".four" ).css( { marginleft: "0" }); $( "#slide2" ).animate( { margintop: "0" }, { duration: 1000 }); $( "#slide3" ).animate( { margintop: "0" }, { duration: 1000 }); $( "#slide4" ).animate( { margintop: "0" }, { duration: 1000 }); $( "#slide5" ).animate( { margintop: "0" }, { duration: 1000 }); $( "#betting-money" ).val("0"); $( "#results" ).hide(""); $( "#winner" ).hide(""); $( "#next-end" ).hide(""); //trying unselect form input selection $("#race input option:selected").attr("selected", ""); //new random number generated... doesn't work var randomnum1 = math.ceil(math.random(20)*10000); var randomnum2 = math.ceil(math.random(20)*10000); var randomnum3 = math.ceil(math.random(20)*10000); var randomnum4 = math.ceil(math.random(20)*10000); });
i think declaring different variables in different scope. seek removing var
sec time set variables:
randomnum1 = math.ceil(math.random(20)*10000); randomnum2 = math.ceil(math.random(20)*10000); randomnum3 = math.ceil(math.random(20)*10000); randomnum4 = math.ceil(math.random(20)*10000);
and help see html code form you're trying unselect.
javascript jquery
Comments
Post a Comment