
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Return a Random Number Between 1 and 200 with JavaScript
To return a random number between 1 and 200, use the JavaScript's Math.random() and Math.floor() method.
Example
You can try to run the following code to return a random number in JavaScript.
<!DOCTYPE html> <html> <body> <script> document.write(Math.floor(Math.random() * 200) + 1); </script> </body> </html>
Advertisements