JavaScript Project | Build Simple Calculator With JavaScript HTML CSS

  Рет қаралды 208,291

Tech2 etc

Tech2 etc

Күн бұрын

Пікірлер: 409
@Tech2etc
@Tech2etc 3 жыл бұрын
Build Simple Calculator With JavaScript HTML CSS | JavaScript Project - Need Your Support Guys. Help Me To Reach 100K SUBSCRIBERS 🔥 More JavaScript Projects: kzbin.info/aero/PL9bD98LkBR7P16BndaNtP4x6Wf5Ib85Hm Timestamps: 0:00 Introduction 1:57 File Directory Setup 2:40 HTML Structure 6:38 CSS Styling 13:33 JavaScript Implementation 21:07 Calculator Output ** If you are facing any problem with equal or clear button. Then go to html file. And if you have btn class inside the equal or clear button, then change them to btn-grey. Hopefully it should fix your problem.
@raaedshehata
@raaedshehata Жыл бұрын
still the same i change it in my html file and my js file with btn-grey but still the same
@mukhtarakinloye7958
@mukhtarakinloye7958 Жыл бұрын
@@raaedshehata battling with the same problem
@shloksuman8164
@shloksuman8164 Жыл бұрын
@@raaedshehata = C
@akshaykumardkr
@akshaykumardkr Жыл бұрын
My Buttons Are Not Working in the senese I can't access Them why because we we did pointer events none plese help me with that
@shloksuman8164
@shloksuman8164 Жыл бұрын
@@akshaykumardkr define pointer-events : none only inside form input
@ratanmanjari7757
@ratanmanjari7757 2 жыл бұрын
if anyone facing issue with equal or clear button coming as undefined, then please remove btn class from equal and just make the class name as btn-equal or btn-clear and update the app.js accordingly.
@vaibhav_prajapat_7725
@vaibhav_prajapat_7725 2 жыл бұрын
Hey buddy. Thanks. You got the bug and helped. As a beginner I couldn't not be able to find it.
@ThawHtooZin222
@ThawHtooZin222 2 жыл бұрын
Thank you very much I was having trouble there too.
@chetan9394
@chetan9394 2 жыл бұрын
Thank you
@ramazborchashvili7976
@ramazborchashvili7976 2 жыл бұрын
Thanks a lot🙏🙏
@chittadigitalnetwork6242
@chittadigitalnetwork6242 2 жыл бұрын
Thanks your a god
@nofriyan184
@nofriyan184 2 жыл бұрын
Thanks man... If anyone got problem with undefined.. Change your html in equal and clear attribute "button" with this code .... class = 'btn-grey btn-equal' >= .... class = 'btn-grey btn-clear' >C Idk what's wrong with explanation code, hope you guys can explain to me.. *sorry for bad english
@amaximus4664
@amaximus4664 2 жыл бұрын
thanks for your advice, it worked.
@genztechman
@genztechman 2 жыл бұрын
Thanks it works
@josephdacostaribeiro2090
@josephdacostaribeiro2090 2 жыл бұрын
valeu amigo ajudou muito
@sachibuibrahim4438
@sachibuibrahim4438 2 жыл бұрын
Thanks
@fr_itz014
@fr_itz014 2 жыл бұрын
thanks man, it worked👍
@hithardhksvln5302
@hithardhksvln5302 Жыл бұрын
Excellent way of Teaching sir. While I was implementing I got to capture a bug/ improvisation for the calculator you built. After using '=' button, if you are clicking on any other button it has to clear the screen and take the input. One more idea is the screen should not take symbols(+,-,*,/) at the begging since we are simply using the eval() function of JS, we need such validations I guess:)
@acebailey2478
@acebailey2478 2 жыл бұрын
REMOVE the btn class from your Clear and Equal buttons. If you don't you may run into the same trouble I did with the 'eval' portion of the IF Else statement.
@user-ve6bw1lt7t
@user-ve6bw1lt7t Жыл бұрын
Thank you!, I was looking for what I was doing wrong and now i found it and solved it.
@desdaderpinater439
@desdaderpinater439 Жыл бұрын
big help, thank you!
@francisdominicbermas2648
@francisdominicbermas2648 Жыл бұрын
salute for sharing this. i was stuck for almost an hour figuring this. thanks
@RoopashreeHV
@RoopashreeHV Жыл бұрын
thank you 😊
@CommanderKurn
@CommanderKurn Жыл бұрын
What do you replace it with or how should the line of code read?
@Lashistoriasdelilith
@Lashistoriasdelilith Жыл бұрын
Loved this video, I'd like to know what's target, dataset, num, addEventListener, querySelector, y querySelectorAll and how they work
@princekaushikk
@princekaushikk Жыл бұрын
first of all thank you explaining in easy or simple way. you simplify all line of code very easy everyone can understand your code. i have a suggestion for you brother make a second channel where you upload same tutorial but in hindi beacuse in hindi code no one can explain like you.
@trk1216
@trk1216 Жыл бұрын
Thank you sir it's working after changing the classes and you have explained the js logic easily in simpler way ...thank you sir
@vimalsinghgaur
@vimalsinghgaur Жыл бұрын
same here
@ChefnCoder
@ChefnCoder 9 ай бұрын
really awesome explanation of each line, took me just an hour to finish up and code too
@respectgmechager8054
@respectgmechager8054 2 жыл бұрын
use this if u have problem in equals and clear button = C
@shrutirohila7869
@shrutirohila7869 2 жыл бұрын
THANK YOU !!
@theblackbenguine8129
@theblackbenguine8129 Жыл бұрын
🔥
@nostalgiagameplay3933
@nostalgiagameplay3933 Жыл бұрын
little fix here, if you still get undefined with equal button, just delete conditional statement like below this : if (screen.value = '') { screen.value = ''; } else { } and leave the following code below : let answer = eval(screen.value); screen.value = answer; so it suppose to be look like this : equal.addEventListener('click', function(e) { let answer = eval(screen.value); screen.value = answer; }); it should fix undefined error, i don't know why but i just found out the source of the problem is in that conditional statement
@vikrambam1184
@vikrambam1184 2 жыл бұрын
if anybody have a equal undefined error here is a solution.... remove btn class in equal and do css with only eqaul or any class name.
@blessingsunday5272
@blessingsunday5272 2 жыл бұрын
thanks for this
@amrholo4445
@amrholo4445 2 жыл бұрын
Thanks alot man
@vatansrivastava7279
@vatansrivastava7279 2 жыл бұрын
Thank You so much. I was stuck there for more than hours
@adrianCoding
@adrianCoding Жыл бұрын
Thank you that was the solution!
@MohitKumar-jy6hf
@MohitKumar-jy6hf Жыл бұрын
Amazing knowledge about front end
@ourmaths8293
@ourmaths8293 5 ай бұрын
thanks it worked, I removed btn class from = and C.
@talibhusain3335
@talibhusain3335 Жыл бұрын
Excellent 🔥, Thankyou so much brother for explain each concept very easily.❤️
@ajaydevgan24
@ajaydevgan24 Жыл бұрын
Everything is perfect sir you are awesome you gained my respect and a subscriber
@sajjadlatafaty2547
@sajjadlatafaty2547 3 жыл бұрын
Thank you very much. I'm a novice. You helped me a lot in learning JavaScript
@Tech2etc
@Tech2etc 3 жыл бұрын
Glad to hear that😊
@brozamgeneral
@brozamgeneral Жыл бұрын
Thanks for the simplified way of teaching, some complicate everything
@Chiillybro
@Chiillybro Жыл бұрын
super informative and thanks to comments for the undefined fix that was wierd
@arvinbonggal5443
@arvinbonggal5443 Жыл бұрын
Greate tutorial! I learned a lot specially on debugging the code as I encountered an issue with regards to button function, I have added additional class to yellow and gray button which is crucial for calculating value and excluded equals and clear as they don't have value so during button click i don't get undefined when I click equals and clear.
@ANTIDOTEBDOFFICIAL
@ANTIDOTEBDOFFICIAL 2 жыл бұрын
Simple/Easy to Understand/Easy to Learn ❤❤
@Tech2etc
@Tech2etc 2 жыл бұрын
Thank you so much. Please share this project on your social media. Will appreciate that.
@better-health-now
@better-health-now Жыл бұрын
why do the buttons need a 2nd class? like btn btn-grey ?
@debadey8614
@debadey8614 Жыл бұрын
Please don't go on adding event listeners to every button as it will make the code inefficient brother. Rather use event delegation pattern and apply the event listener on button container class. Anyway, great tutorial!!
@sahiraahamed
@sahiraahamed Жыл бұрын
Alhamdulillah.. Understood👏
@clarisseaguirre6161
@clarisseaguirre6161 Жыл бұрын
this was very useful to me I almost cried because I thought I won't make the deadline 🤧
@helaluddin6209
@helaluddin6209 2 жыл бұрын
This tutorial was amazing.. well explained.. thanks for sharing
@Tech2etc
@Tech2etc 2 жыл бұрын
Your welcome.
@victoriaazola6409
@victoriaazola6409 Жыл бұрын
I did my equal button like this and it worked (also deleted de btn class in the html): equal.addEventListener("click", (e) => { if (screen.value !== " ") { //if the screen isn´t empty let answer = eval(screen.value) //we calculate the aswer screen.value = " "; //clear the screen screen.value += answer; //and show the answer } })
@pavangupta4866
@pavangupta4866 Жыл бұрын
thanks, my equal btn is working now
@bhakthasingh8198
@bhakthasingh8198 2 жыл бұрын
Excellent Programming with minimal code!
@Tech2etc
@Tech2etc 2 жыл бұрын
Thank you.
@anneldahnce1661
@anneldahnce1661 2 жыл бұрын
You are the best Sir
@Tech2etc
@Tech2etc 2 жыл бұрын
Thank you dear.
@Dragon-facts-d3j
@Dragon-facts-d3j Жыл бұрын
Perfect work mate!
@Ishablogs1
@Ishablogs1 Жыл бұрын
I find one problem in this calculator.. If any one type wrong no. Then.. There is no option to delete the value.. But overall calculator and teaching way is good.
@daniesavage
@daniesavage Жыл бұрын
the clear (C) button deletes the value 😊😊
@synthtech485
@synthtech485 2 жыл бұрын
Great respect for you sir gajabbbbbbb explanation
@Tech2etc
@Tech2etc 2 жыл бұрын
Thank you brother
@MathSCSil
@MathSCSil Жыл бұрын
Thank you for this playlist
@girlwhoinvests
@girlwhoinvests Жыл бұрын
Hi awesome tutorial. Can someone explain the data-num to me that's on html? I've been googling but still don't know why it's needed and why was it not needed for the equals and C buttons?
@YesheyTshokgyelBidha
@YesheyTshokgyelBidha Жыл бұрын
me too
@remy333
@remy333 Жыл бұрын
Thanks for this tutorial. One problem that many of us are having that still isn't rectified is that 'click' events are not being recognized. This is unrelated to the problem in the pinned comment. For example, vscode shows the event listener as unrecognized and either void or null when hovering over the click events: (method) Element.addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void (+1 overload) ^^undefined? Also, regarding the use of e.target.dataset.num... is this supposed to be built in? Do we need to import something? We never declare or name any object as dataset, but vscode doesn't autocomplete that term. Were we supposed to tie the term dataset to the number button classes somehow so it would be recognized? These aspects are really tough for what should be a simple calc. I went back through the video 6 times slowly and checked every character. Has something changed since this video that would cause us to struggle so much at this part? Some people said to make sure the script is invoked from withing the html body, and it is. Everything else works fine up until trying to click a number button and have the number display on the upper screen. But I'm copying you verbatim. I promise. I'm a full time developer, but I mostly work on python based backend work, and lots of terraform configs. I'm very careful with punctuation and indentation. But like a handful of others here, I can't get this click event to cause the numbers to display. I am admittedly brand new to frontend work and js, so maybe its some setting I'm unaware of? Please help. Thanks again and Happy New Year 2023!!!
@Tech2etc
@Tech2etc Жыл бұрын
I really admire your dedication towards frontend work. Can you upload your code in codepen or GitHub? So that i can have a look and tell you exactly what is going on in your code. You can connect with me through discord.
@remy333
@remy333 Жыл бұрын
@@Tech2etc you’re the best. Thank you! I’ll add it to git and stop by to join your discord. I very much appreciate you and your knowledge sharing. Have a great new year!
@100x2xp
@100x2xp Жыл бұрын
@@remy333 did you find out the problem if so what was it?
@bunmiYomi
@bunmiYomi Жыл бұрын
I am having This same challenge and I am yet to get a solution even in the comments. Would anyone be able to help? When I click, it does not display anything on the screen like the tutorial. I always struggle with JavaScript as I never get the outputs as in the tutorials I watch. I am a bit tired and frustrated. Please, helpppppppp.
@mouhamedzahri2172
@mouhamedzahri2172 Жыл бұрын
@@bunmiYomi bro i'm facing the same problem, in multi projects i find problems. did you fix it?
@AdityaG.
@AdityaG. Жыл бұрын
Here is the solution for your que: if you have a equal undefined error remove 'btn' class in equal in html...
@krishchaudhary5885
@krishchaudhary5885 3 жыл бұрын
Its amazing 😍😍 Tq bro 👍
@Tech2etc
@Tech2etc 3 жыл бұрын
Most Welcome
@mericgencay7109
@mericgencay7109 2 жыл бұрын
excellent tutorial with awesome accent bro :D
@shubhamkatiyar5913
@shubhamkatiyar5913 2 жыл бұрын
How to fix document is not defined error in vscode node js 🙂
@lymphliar
@lymphliar 2 жыл бұрын
Thank you for this short and helpful tutorial.
@Tech2etc
@Tech2etc 2 жыл бұрын
Your most welcome. Please share this project on your social media. Will appreciate that.
@jamil_mikael
@jamil_mikael 2 жыл бұрын
Great tutorial , I've followed all the steps and now have a calculator.. problem is the equal sign keeps saying 'undefined' !
@Tech2etc
@Tech2etc 2 жыл бұрын
please check the pinned comment.
@ayushshankarpurkar1417
@ayushshankarpurkar1417 Жыл бұрын
use the class for both as class="btn-equal" and "btn-clear" in the place of class = "btn btn-grey" because in the javascript it calls both the class btn and btn-clear at the same time so it becomes undefined for it. Hope it helps you even after 3 months XD!
@devotionalofgod820
@devotionalofgod820 Жыл бұрын
@@ayushshankarpurkar1417 Thanks It Help me now
@nothing-tj9eh
@nothing-tj9eh Жыл бұрын
my java script not working like even i click butons dosn't show numbers
@Prar2001
@Prar2001 2 жыл бұрын
On clicking any button its not appearing on screen please help
@riadzoabi
@riadzoabi 7 ай бұрын
let buttons = document.querySelectorAll('.btn');
@chiragsolanki1234
@chiragsolanki1234 2 жыл бұрын
l have typed same code like you but any buttons is not working😔😔😕😕😏😏
@fidelishub
@fidelishub 2 жыл бұрын
same here
@kehindeomole713
@kehindeomole713 2 жыл бұрын
Thanks so much, I truly appreciate
@Tech2etc
@Tech2etc 2 жыл бұрын
Most welcome
@xenonebanihal3979
@xenonebanihal3979 Жыл бұрын
equal button is showing undefined in screen.value pl guide
@AbhishekMishra-gr5zk
@AbhishekMishra-gr5zk Жыл бұрын
Thanks you so much this video is really very helpful to practice the js code || Subscribed 😍
@celiat2945
@celiat2945 Жыл бұрын
hey, thx for this But can someone explain me why we start with a function and do the code in it ? I never saw that (i'm a junior dev)
@vimalsinghgaur
@vimalsinghgaur Жыл бұрын
not need to start with function, you simply create variables, create function for buttons, equal & clear. It will work
@mrrobot4504
@mrrobot4504 11 ай бұрын
Great video 🙏🙏
@ajLisama
@ajLisama 2 жыл бұрын
Thank you very much for sharing this tutorial. It is well explained, very clear, and informative.
@Tech2etc
@Tech2etc 2 жыл бұрын
Thank you so much. Please share this project on your social media. Will appreciate that.
@JamateSirajiaFaisalabad
@JamateSirajiaFaisalabad 2 жыл бұрын
Very Good Tutorial, Thanks
@CookiesNCreme-ty6wz
@CookiesNCreme-ty6wz 2 жыл бұрын
Thank you for this tutorial but how about decimals? When I press decimal more than once more than one decimal appears on screen?
@vimalsinghgaur
@vimalsinghgaur Жыл бұрын
screen.value = answer.toFixed(2); instead of screen.value = answer;
@Chandraprakash-kx4ic
@Chandraprakash-kx4ic Жыл бұрын
❤Thanku so much Bhai ❤
@haripalsingh9430
@haripalsingh9430 Жыл бұрын
thanks sir it is easy to use and understand
@Tech2etc
@Tech2etc Жыл бұрын
You are most welcome. More projects are coming soon. Please share this project on your social media. It will help us. Thanks.
@shaffizan
@shaffizan 2 жыл бұрын
i have question. whats different between background: and background-color:
@Tech2etc
@Tech2etc 2 жыл бұрын
"The major difference between CSS background vs background-color property is that the background property is shorthand of all background properties. On the other hand, the background-color property is the subset of the background property used to set the background color" - Google Note: Please try to be smart. When you can get the answer in a few mili second by searching on google. Then please dont wait for days or weeks or months to get a simple answer in youtube. Thanks.
@onyekastephen2250
@onyekastephen2250 2 жыл бұрын
In my vs code i followed up all the rules exactly the way it was coded in this tutorial; when it came to the part where you click on buttons they won't show on the screen, I've cross-checked to know if there was an error to my coding (all to no avail). What might be this problem?
@Tech2etc
@Tech2etc 2 жыл бұрын
kindly check the pinned comment
@kirankumarp4537
@kirankumarp4537 Жыл бұрын
@@Tech2etc same here bro , not showing clicked buttons on screen ...even I altered to .btn-clear & .btn-equal and for buttons .btn
@laughviral2640
@laughviral2640 Жыл бұрын
@@kirankumarp4537 I had the same problem but i fixed it. check in the app.js that the function is in brackets like this (function(){ let screen = document.querySelector('.screen') let buttons = document.querySelectorAll('.btn') let clear = document.querySelector('.btn-clear') let equal = document.querySelector('.btn-equal') buttons.forEach(function(button) { button.addEventListener('click', function(e) { let value = e.target.dataset.num; screen.value += value; }) }); })();
@khannooru3045
@khannooru3045 Жыл бұрын
bhai script file ko connect kero sab bara bar chalega
@RishabhYadav-ej7cz
@RishabhYadav-ej7cz Жыл бұрын
you need to call function by adding the parenthesis in the end (function (){ })()
@frankkuper9861
@frankkuper9861 8 ай бұрын
Nice vid, thanks!
@ExplorerPchand
@ExplorerPchand Жыл бұрын
thank you so much sir
@chiamakamiriam3728
@chiamakamiriam3728 Жыл бұрын
Thanks alot for sharing. I do appreciate 🙏. However, when i get a value for example 2+3 =5, if I type 2 it should clear the 5 rather than be 52. I don't know if anyone encountered such problem. How do I fix it?
@vimalsinghgaur
@vimalsinghgaur Жыл бұрын
i faced same problem
@muratyldrm2298
@muratyldrm2298 Жыл бұрын
buttons.forEach(function (button) { button.addEventListener("click", function (e) { if(screen.value == "Please enter"){ screen.value=""; }else if(screen.value == answer){ screen.value=""; } let value = e.target.dataset.num; screen.value += value; }); });
@ryanzogheib7982
@ryanzogheib7982 Жыл бұрын
what extension are you using to make your vscode look like that? also whenever I type in a number it puts it into the input box twice so if i hit 9 it will put "99" instead of "9"?
@oussamazahid_
@oussamazahid_ Жыл бұрын
it might one of the Community Material Themes In vscode search for Community Material Theme
@Poem_AI
@Poem_AI Жыл бұрын
Splendid!
@aritnath151
@aritnath151 Жыл бұрын
what is that e.target.dataset.num????????????? please somebody explain. where is the num, dataset coming from
@CommanderKurn
@CommanderKurn Жыл бұрын
Typed the style.css .calculator part exactly the same as yours but there is no rectangle box appearing in browser
@PerdeDor0
@PerdeDor0 2 жыл бұрын
i did exactly same but buttons are not working , i cant click any buttons
@hanamuse2569
@hanamuse2569 Жыл бұрын
Me too , what u did?
@yubasmitaamchi6519
@yubasmitaamchi6519 Жыл бұрын
Me too. Same issue
@nikhilkolnurkar2310
@nikhilkolnurkar2310 Жыл бұрын
Same here 😔, have you solved the issue?
@thezeeshann
@thezeeshann 2 жыл бұрын
bro which theme are used for vscode
@oneness2728
@oneness2728 2 жыл бұрын
Sorry, I did as exactly you say. But am having difficulty in outputting the result. i.e the eval(screen.value) It always bring out undefined. Can you pls explain to me why.
@aananmunna
@aananmunna 2 жыл бұрын
I have the same problem🙄
@gaurikasharma8778
@gaurikasharma8778 Жыл бұрын
same
@miklosvasarhelyi8891
@miklosvasarhelyi8891 Жыл бұрын
@@gaurikasharma8778 @noak-manuel nwobodo, @aanan munna I had the same but read the comments and found that you need to remove the class "btn" from your equal button in HTML (so leave only btn-equal). GL!
@gaurikasharma8778
@gaurikasharma8778 Жыл бұрын
@@miklosvasarhelyi8891 already did it but didn't work
@Ryu-ky5vt
@Ryu-ky5vt Жыл бұрын
@@gaurikasharma8778 you found the solution bro?
@riturajpathak1905
@riturajpathak1905 Жыл бұрын
Whats the purpose of wrapping everything around the function? Can someone tell me?
@panzagamesplay902
@panzagamesplay902 Жыл бұрын
thanks i understand the video but the api has being taken down,not working
@amenetefia3213
@amenetefia3213 Жыл бұрын
bro what are you typing when did you type ( please enter ) i never saw it, and the code it not even working perfectly my = is doing the job of my clear bro
@facundodtd
@facundodtd 2 жыл бұрын
everything went well except that the calculator is not functional... when I do a division or something else, the result is undefined. For example "9/3undefined"
@Tech2etc
@Tech2etc 2 жыл бұрын
Please recheck your code again. There shouldn't be any problem. But If you are facing any problem with equal or clear button. Then go to html file. And if you have btn class inside the equal or clear button, then change them to btn-grey. Hopefully it should fix your problem.
@facundodtd
@facundodtd 2 жыл бұрын
@@Tech2etc I solved it, thanks for your time dude
@leoodion1154
@leoodion1154 2 жыл бұрын
Thanks bro. This helped me as well.
@codingwithankit7619
@codingwithankit7619 2 жыл бұрын
thanks bro
@satendrayadav901
@satendrayadav901 2 жыл бұрын
@@facundodtd how u solve this problem
@info.kannada
@info.kannada Жыл бұрын
i did as per you equal(=) is showing undefined, you did not tell properly in vedio
@Logicrealtor_dubaipro
@Logicrealtor_dubaipro 2 жыл бұрын
Pls can you make a tutorial video for React Js?
@Tech2etc
@Tech2etc 2 жыл бұрын
sure... In future...
@yokiyoki2538
@yokiyoki2538 Жыл бұрын
bro if number click and add another number click did'nt come continuesoly
@daveyclysm483
@daveyclysm483 2 жыл бұрын
Thanks pal
@Tech2etc
@Tech2etc 2 жыл бұрын
Your welcome
@emmanueloluwadamilolaajala225
@emmanueloluwadamilolaajala225 8 ай бұрын
This is nice but I'm having a problem here. My own calculator didn't give me the answer whenever I want to calculate. It keeps saying undefined and I followed all what you said in this video
@royalcoc4817
@royalcoc4817 4 ай бұрын
try{answer = eval(screen.value); screen.value = answer; Catch(err){ screen.value= "error"; }
@LVNavyaSree
@LVNavyaSree 2 жыл бұрын
when im clicking on a button it doesn't appear on the screen my function code is correct but still not getting what to do? buttons.forEach(function(button){ button.addEventListener('click', function(e) { let value = e.target.dataset.num; screen.value += value; }) }); equal.addEventListener('click',function(e){ if(screen.value === ''){ screen.value = "Please Enter"; }else{ let answer = eval(screen.value); screen.value=answer; } }); clear.addEventListener('click',function(e){ screen.value=""; });
@king201192
@king201192 2 жыл бұрын
you must add this (single quotes/ double quotes) like this if(screen.value === ' ') { note : if u still facing the issue then check the selectors. let screen = document.querySelector('.screen'); let buttons = document.querySelectorAll('.btn'); let clear = document.querySelector('.btn-clear'); let equal = document.querySelector('.btn-equal');
@yubasmitaamchi6519
@yubasmitaamchi6519 Жыл бұрын
I'm also facing the same issue. buttons.forEach is not a function is showing
@AFTROGAME
@AFTROGAME 6 ай бұрын
Please answer or explain why equal is not working, I'm waiting!
@royalcoc4817
@royalcoc4817 4 ай бұрын
Use try catch error
@royalcoc4817
@royalcoc4817 4 ай бұрын
@@AFTROGAME try{answer = eval(screen.value); screen.value = answer; Catch(err){ screen.value= "error"; }
@malakdahdah2041
@malakdahdah2041 2 жыл бұрын
i have a problem? can you help me? inactive typing on the calculator ?why
@zionobeloved5777
@zionobeloved5777 Жыл бұрын
Hello please wen ever I click a number in the calculator it loops
@srimoyeebanerjee2004
@srimoyeebanerjee2004 Жыл бұрын
please somebody describe what is the functionality of eval()
@tanzeelaghafoor5210
@tanzeelaghafoor5210 Жыл бұрын
Mery calculator project MN click ki funtionaly q ni add ho rhi???
@nikeshajalkar6649
@nikeshajalkar6649 2 жыл бұрын
thank you
@Tech2etc
@Tech2etc 2 жыл бұрын
Most welcome
@AnimeXCulture
@AnimeXCulture Жыл бұрын
I keep getting undefined when I click the equals button?
@1989SeanSmith
@1989SeanSmith Жыл бұрын
If you want to round the answer to a particular number of decimal places, you can set the screen value as follows: screen.value = answer.toFixed(3) The 3 is the number of decimal places you would like the result to show. This will avoid any really long answers from going off the side of the screen
@mohamedahmed-ct9td
@mohamedahmed-ct9td Жыл бұрын
I have a problem when i click on any buttons and don't do any calculation and then press on clear button, the value doesn't clear. Do anyone have a soluation for it.
@Nepc_explains
@Nepc_explains Жыл бұрын
Can anyone please write down the first code in that css file that was written down I can't see it clearly
@umamahaswarikarre8062
@umamahaswarikarre8062 2 жыл бұрын
i copied the code as it is but still the buttons are not working. Can any one help?
@hanamuse2569
@hanamuse2569 Жыл бұрын
Same ,what u did?
@ssano-bc2jz
@ssano-bc2jz Жыл бұрын
Same problem 😢
@thezeeshann
@thezeeshann 2 жыл бұрын
thanks bro
@Tech2etc
@Tech2etc 2 жыл бұрын
Most welcome bro
@rayhanbhai5503
@rayhanbhai5503 2 жыл бұрын
sa,e bro tNice tutorials is fire
@Tech2etc
@Tech2etc 2 жыл бұрын
Thanks
@Ankushmehra0411
@Ankushmehra0411 Жыл бұрын
how to set input limit ?
@trngotube7607
@trngotube7607 Жыл бұрын
good but this calculator have some error because when we press the opretor more than one time it will add them multi times
@maxlow8449
@maxlow8449 2 жыл бұрын
where is the class btn in the CSS
@keshavsharma7507
@keshavsharma7507 2 жыл бұрын
why i am gatting undifinen on screen with digits
@waqarali191
@waqarali191 Жыл бұрын
js code neither showing any output nor any error
@suryanathchakrabarti530
@suryanathchakrabarti530 Жыл бұрын
How to use enter keyas a equal button...can someone help please?
@royalcoc4817
@royalcoc4817 4 ай бұрын
try{answer = eval(screen.value); screen.value = answer; Catch(err){ screen.value= "error"; }
@stephengichia154
@stephengichia154 Жыл бұрын
if it's not working check if you remerbered to invoke the function
@syednehalhussain7581
@syednehalhussain7581 2 жыл бұрын
i just did same as you but still its not working specially equal and clear button ? can you explain tho?
@syednehalhussain7581
@syednehalhussain7581 2 жыл бұрын
and when i press equal button its shows undefined so can you please help me out?
@sanjansvlogs
@sanjansvlogs Жыл бұрын
If I press 042, the result is 34 .Its showing like this please resolve this.
@yubasmitaamchi6519
@yubasmitaamchi6519 Жыл бұрын
buttons.forEach is not a function is showing. what to do sir?
@pranav8534
@pranav8534 Жыл бұрын
@Jatin Vats Ask ChatGPT, and it will help you.
@noviaamarsheilaa5344
@noviaamarsheilaa5344 2 жыл бұрын
why it's not working when I click the button and giving a value the undefined? I didn't have error or typo in my code
@Tech2etc
@Tech2etc 2 жыл бұрын
If you are facing any problem with buttons. Then go to html file. And if you have btn class inside the equal or clear button, then change them to btn-grey. Hopefully it should fix your problem.
@danialkhan4994
@danialkhan4994 Жыл бұрын
@@Tech2etc i have done but still In clear code is not working C clears.addEventListener('click', function(e) { screen.value=""; }; Please expalin what is this
@danialkhan4994
@danialkhan4994 Жыл бұрын
@@Tech2etc when i save the clear code it's cant perform any operation but when i do the code in comment it work Please explain how to fix it
Build this JS calculator in 15 minutes! 🖩
15:20
Bro Code
Рет қаралды 644 М.
Ice Cream or Surprise Trip Around the World?
00:31
Hungry FAM
Рет қаралды 5 МЛН
CAN YOU DO THIS ?
00:23
STORROR
Рет қаралды 49 МЛН
JavaScript Project | Image Search App With JavaScript API
48:19
Tech2 etc
Рет қаралды 231 М.
how to build a simple calculator using javascript
27:22
Ranjan-Beginner's Guide
Рет қаралды 80 М.
Создаем калькулятор 👨‍💻  JavaScript. Без eval, по шагам для начинающих
25:04
WebDev с нуля. Канал Алекса Лущенко
Рет қаралды 139 М.
Create a simple calculator using HTML, CSS, JavaScript
13:35
JavaScript Academy
Рет қаралды 252 М.
How To Make A Calculator Using HTML CSS And JavaScript
19:01
GreatStack
Рет қаралды 919 М.
Build A Calculator With JavaScript Tutorial
38:50
Web Dev Simplified
Рет қаралды 1,5 МЛН
Build A Clock With JavaScript
17:43
Web Dev Simplified
Рет қаралды 361 М.
Ice Cream or Surprise Trip Around the World?
00:31
Hungry FAM
Рет қаралды 5 МЛН