Topics: The document keyword , Tweak an Element , Select and Modify Elements , Style an element , Create and Insert Elements , Remove an Element , Interactivity with onclick , Traversing the DOM , What is an Event? , "Firing" Events , Event Handler Registration , Adding Event Handlers , Removing Event Handlers , Event Object Properties , Event Types , Mouse Events , Keyboard Events
Project Title: Lucky Numbers
- Create a html file with your name like john.html
- Add current code to that file:
<!DOCTYPE html> <html> <body> <script> // your code here </script> </body> </html>
Create a h1 with "Lucky Number" text.
Create a button set caption to lucky number. When user click on it alert a random number between 1 to 10.
Create another button set caption to Guess Number. It prompt a number from user and check if it equal to lucky number alert "You won" else aler "You lose."
After 10 seconds of loading page, show a small banner at the top of the page and show this message: " You are winner . Do not give up" Put a close button next to banner and remove the banner when user click on it.
Want to get reviewed?
Send Pull Request. Check how to deliver your code: https://codingwithbasir.com/how-to-deliver-projects/