Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
getting a random element from an array in javascript
<!--This code runs in your browser. If you want to see errors, examine them in your browser's developer console (usually invoked with F12)--> <!DOCTYPE html> <html> <head> <title>Hello, world!</title> <meta charset="utf-8" /> </head> <body> <button onclick="getRandomElement()">get random element</button> <script> function getRandomElement() { var myArray = ["Jan", "Feb", "Jul", "Sep", "Okt", "Dec"]; window.alert(myArray[Math.round(Math.random() * myArray.length)]); } </script> </body> </html>
run
|
edit
|
history
|
help
0
Half
SY Loader
Bgcolor.html
Basic player movement
HTML5 Button
90's emoji cursor
uj
Search engine
look 🤓im 🤓such🤓 nerd🤓 I 🤓coded🤓 rextester🤓 in 🤓rextester 🤓
3d cube (NOT MADE BY ME!!!!!)