This is a follow up of The Odin Project course, target attempt to create a calculator Web Page.
-
I learned more about event listeners for instance how to make it listen to specific targeted node, check this snippet.
e.target.innerHTML = 'AC';
-
Learned more about the onclick="" event listener.
-
I don't get why
querySelector()
does not work in an instance like this where the.value
syntax is used but instead it works withgetElementById()
.const element = document.querySelector('.node'); const action = () => { element.value = 'placeholder'; };
Love this work? Buy me a coffee...
Want to contribute? Great!
To fix a bug or enhance an existing module, follow these steps:
-
Fork the repository
https://github.com/keithowino/top-calculator/fork
-
Create a new branch
git checkout -b improve-feature
-
Make the appropriate changes in the files
-
Add changes to reflect the changes made
-
Commit your changes
git commit -am 'Improve 1, 2... feature'
-
Push to the branch
git push origin improve-feature
-
Create a Pull Request
-
To clone this repository to your machine do this in the root directory of where you would like to save the project. Before using this be sure which url link you should use, is it for HTTP or SHH.
git clone https://github.com/freestyletear/top-calculator
-
Open the repository.
cd top-calculator
-
Navigate to index.html and open it on your favorite browser Your browser must be JavaScript enabled for this to work
- Steady Network.
- Weblink
- Github account.
-
If you find a bug (the website couldn't handle the query and / or gave undesired results), kindly open an issue here...
https://github.com/keithowino/top-calculator/fork
- The Odin Project suggests that using
eval()
as a means to evaluate a string of code is a bad idea, thus let's learn more about it and do the necessary changes. - I will add the functionality that allows a user to enter specific keyboard arguments i.e.
Enter
,Numbers
,Backspace
and more. event.preventDefault is a link from TOP for further assistance. - I will add the functionality that disables the possibility of adding a decimal if there's already one.