Search
 
SCRIPT & CODE EXAMPLE
 

HTML

random number text in html

<button class="button" onclick="RandomID();" style="font-family: sans-serif;">RUN</button>
<input class="input" type="text" id="id" name="id" size="3" readonly />
Comment

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;
}
Comment

PREVIOUS NEXT
Code Example
Html :: xss html 
Html :: image is too big html 
Html :: default php version ubuntu 20.04 
Html :: strong and bold difference in html 
Html :: angular html variable 
Html :: how to put h1 in html 
Html :: code live html css online 
Html :: how to write < in html 
Html :: call angular function from html 
Html :: html style guide 
Html :: html description list 
Html :: Przezroczysty div 
Html :: footer html stack overflow 
Html :: validates uniqueness of two columns rails 
Html :: you may need an appropriate loader to handle this file type html 
Html :: how to 
Html :: html click on link to open text message 
Html :: readhtml tags in python 
Html :: how often does wordle reset 
Html :: internal phone input 
Html :: html code for birthday wishes 
Html :: ionic checkbox value by function 
Html :: live tiles 
Html :: HTML - Textbox appears when hovering over 
Html :: hide input field title show when it is filled 
Html :: selectize add properties to item from html 
Html :: Accesing element using tag 
Html :: week days in table format in html 
Html :: xpath alt contains 
Html :: make element be positioned behind its parent, but in front of its grandparent 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =