Welcome to the Simple Counter Web App project! This is a basic web application that allows users to increment and decrement a counter. It's built using HTML, CSS, and JavaScript.
-
Begin by installing the "Live Server" extension by Ritwick Dey for Visual Studio Code. This extension enables you to easily run HTML files in your browser.
-
Open Visual Studio Code, and on the left-hand side, click on the "Extensions" icon.
-
In the search bar, type "Live Server" by Ritwick Dey and select the extension from the results. Install it.
-
Once the extension is installed, open the HTML file that you've cloned or created. You'll notice a new option at the bottom of your window labeled "Go Live".
-
Click on "Go Live". This will automatically serve your HTML file on a localhost server.
If you've followed the previous steps correctly, you should see a webpage displaying two buttons: "+" and "-", along with the number "0". This constitutes a basic counter application. However, at this point, the buttons do not function as intended.
Here's how you can proceed:
-
Begin by modifying the code in the index.js file to ensure the counter buttons work as expected.
-
Once you've completed the above task, verify that the count functionality is now operational. Clicking "+" should increment the count, while clicking "-" should decrement it.
-
For the next task, implement a feature to prevent the count from going below zero.
Note: It's recommended to attempt these tasks independently. If you encounter difficulties, don't hesitate to utilize resources like Google or ChatGPT. This is a common practice among developers; they often spend more time troubleshooting and fixing bugs than writing new code. Remember, seeking help is a crucial part of the development process.
- Click on the "Fork" button at the top-right corner of this repository's page. This will create a copy of the repository under your own GitHub account.
Clone your forked repository to your local machine using the following command in your terminal:
git clone https://github.com/Sranjan0208/Counter-App.git
- Navigate to the project directory:
cd Counter-App
- Open the
index.js
file and make the necessary changes to the code. This is where you'll implement the counter functionality.
Open the index.html
file in a web browser to test the changes locally.
Once you're satisfied with your changes, commit them to your local repository:
git add .
git commit -m "Add counter functionality"
Push the changes to your forked repository:
git push origin main
- Navigate to your forked repository on GitHub.
- Click on the "Pull Request" button.
- Provide a title and description for your pull request, detailing the changes you've made.