This is a beginner-level project where you will create a simple JavaScript program that displays a "Hello World" alert box when the page is loaded. This project will help you understand the basics of JavaScript and how to interact with the browser's alert function.
Your project should have the following structure:
yourname/
├── index.html
└── script.js
- index.html: The HTML file that includes the basic structure of the webpage.
- script.js: The JavaScript file that contains the code to display the alert.
-
Fork the Repository: Start by forking this repository to your GitHub account.
-
Clone the Repository: Clone the forked repository to your local machine using:
git clone https://github.com/your-username/javascript-mastery-course.git
-
Create a New Branch: Create a new branch for your project using:
git checkout -b hello-world-alert-yourname
-
Create Your Project Folder: Inside the
projects
directory, create a new folder with your name:javascript-mastery-course/ ├── hello-world-alert/ │ └── yourname/ │ ├── index.html │ └── script.js
-
Add Your Files: Add your
index.html
andscript.js
files to theyourname
folder ofhello-world-alert
project. -
Commit and Push: Commit your changes and push them to your forked repository:
git add . git commit -m "Add Hello World Alert project by yourname" git push origin hello-world-alert-yourname
-
Create a Pull Request: Go to the original repository on GitHub and create a pull request from your branch.
- Use the
alert
function in JavaScript to display a message. - Make sure your JavaScript code is linked correctly in the HTML file.
Here’s a simple example of what your index.html
and script.js
files should look like:
index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hello World Alert</title>
<script src="script.js" defer></script>
</head>
<body>
</body>
</html>
script.js:
window.onload = function() {
alert('Hello World');
};
When you open index.html
in a web browser, it should display an alert box with the message "Hello World".
Your submission should follow this structure:
```
javascript-mastery-course/
├── hello-world-alert/
│ └── yourname/
│ ├── index.html
│ └── script.js
```
- Ensure your project follows the file structure guidelines.
- Your submission will be reviewed, and feedback will be provided if necessary.
- Have fun coding and learning JavaScript!
Happy coding! 🚀