Sử dụng Math.floor(Math.random() * 200) + 1 để lấy số nguyên ngẫu nhiên từ 1 đến 200.
Ví dụ
<!DOCTYPE html>
<html>
<body>
<script>
document.write(Math.floor(Math.random() * 200) + 1);
</script>
</body>
</html>
Sử dụng Math.floor(Math.random() * 200) + 1 để lấy số nguyên ngẫu nhiên từ 1 đến 200.
<!DOCTYPE html>
<html>
<body>
<script>
document.write(Math.floor(Math.random() * 200) + 1);
</script>
</body>
</html>