My First JavaScript Mini Project

Divyansh SavitaDivyansh Savita
1 min read

This blog is about what I learn from my first project. This project is all about shifting apples from one basket to another. Interface is pretty basic. In this project I focus on JavaScript logics more.

In this project I make first basket and second basket count for apples, right and left arrow to shift values of apples from one to another basket.

First I take html tag to JavaScript using ' document.getelementbyid ' and storing it in variables. Then I applied event listener to right and left arrow.If you click right arrow then I use if statement which says if first basket variable is greater than 0 than run this event listener. After that value of first apple count variable is decremented and value of second apple count is incremented and with the help of 'innerText' it is passed to first basket and second basket respectively.

And left arrow button is used to transfer apples from second basket to first basket.

github -Myproject/Apples at main · Divyansh-Savita/Myproject (github.com)

JavaScript features used in this project-

  1. document.getelementbyid

  2. Event Listeners

  3. If-else

  4. inner Text

0
Subscribe to my newsletter

Read articles from Divyansh Savita directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Divyansh Savita
Divyansh Savita