Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

random number text in html

function RandomID() {
  var value;
  var rnd = Math.floor(Math.random() * 11);

  if (rnd === 7)
    value = "Wassup";
  else if (rnd <= 5)
    value = "Hello";
  else
    value = rnd;

  document.getElementById('id').value = value;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #random #number #text #html
ADD COMMENT
Topic
Name
8+6 =