insert var into text box

Im somewhat new to javascripting…

I am creating a form on my site where users signup and inside the signup there is a button to press
to roll random numbers and insert them into 2 different boxes

i am generating the random numbers in javascript by

function roll(){
var randomnum1=Math.floor(Math.random()*10);
var randomnum2=Math.floor(Math.random()*10);
//and try inserting with it this way but doesn’t work
document.getElementById(‘randomnum1’).value = randomnum1;
document.getElementById(‘randomnum2’).value = randomnum2;
}

and both the fields have id’s and both match up with the one they need to be but doesn’t insert them into the fields… can someone help me thank you…

never mind I finally figured it out…

Sponsor our Newsletter | Privacy Policy | Terms of Service