Guess The Number is a fun and interactive web-based number guessing game built using HTML, CSS, and vanilla JavaScript. A random number between 1 and 20 is generated, and the player must guess it with hints provided based on the input. The game keeps track of score and high score, encouraging repeated play.
This project was developed to reinforce my JavaScript fundamentals, especially focusing on DOM manipulation, event handling, and implementing conditional logic for user interactions.
🔗👉click here to see the live demo-->https://nanthakumar-m.github.io/Guess_the_number-Javascript/
🚫 Note: This website is not responsive and is best viewed on desktop screens.
- HTML5
- CSS3
- JavaScript
✅ Generates a random number between 1 and 20
✅ Displays real-time feedback: "Too high", "Too low", or "Correct"
✅ Tracks current score and updates high score
✅ Dynamic UI updates (background color, width change, message updates)
✅ "Play Again" button resets game state cleanly
✅ DOM Selection and Event Binding using addEventListener()
✅ Conditional Rendering using if, else if, and ternary operator
✅ Efficient UI updates using class and style manipulation
✅ Real-time input validation and feedback
✅ Practiced clean code principles (like DRY with ternary)
✅ Enhanced logical thinking through game flow development