Onload random number generator


#1

I was created onload random number generater with javascript .but I want to create … that function. … add +1 in onload random number generater when click on button

function fun1(){ 
      var minNumber = 600;
      var maxNumber = 2000;
      var randomnumber = Math.floor(Math.random() * (maxNumber + 1) + minNumber);
      document.getElementById("view").innerHTML = randomnumber;
      return false;
}

var addFunctionOnWindowLoad = function(callback){
      if(window.addEventListener){
          window.addEventListener('load',callback,false);
      }else{
          window.attachEvent('onload',callback);
      }
}

addFunctionOnWindowLoad(fun1); 

#2
  1. Are you wanting the page to load with a random number, and then have a visitor click a button to increase that number by one each time that button is clicked?

  2. Why?


#3

Because I want add a function like button in my Android app project


#4

If the numbers are random, how will you know exactly how many likes you are getting? Shouldn’t you start with 0?