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 :: openGraph 2 
Html :: codesandbox disable prettier 
Html :: Laravel get the data and display it in the blade html failed 
Html :: %2f in query 
Html :: audio controls tag html 
Html :: livewire wire:target multi target 
Html :: read_html pandas skiprows function example 
Html :: put html in iframe 
Html :: label aligned next to input 
Html :: meta initial scale resize to fit screen 
Html :: Improve performance and prevent security vulnerabilities for external links 
Html :: divs 
Html :: HTML <abbr for Abbreviations 
Html :: span value html 
Html :: html insert html snippets 
Html :: hCards 
Html :: infinityblogger.in 
Html :: how to populate a grid with images in html 
Html :: html slider 
Html :: html decode online 
Html :: https://htmlcheatsheet.com/) 
Html :: postcss minify 
Css :: placeholder font size css 
Css :: css how to make text not break 
Css :: three dots in css 
Css :: how to apply css to firefox only 
Css :: disable bullets in ul 
Css :: remove ul decoration 
Css :: how to remove link blue color from a tag using css 
Css :: disable text wrap css 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =