Тёмный

JavaScript Calculate 2 Numbers Form Input Text - Addition, Subtraction, Multiplication, Division 

1BestCsharp blog
Подписаться 121 тыс.
Просмотров 318 тыс.
50% 1

How To Calculate Two Numbers In JavaScript : sum, minus, duplication, division
Source Code:
1bestcsharp.blogspot.com/2017/...
Javascript Tutorials For Beginners ➜ bit.ly/2k7NMWq
Web Development Projects ➜ bit.ly/PHP_PROJECTS
Javascript Course ➜ bit.ly/2IvBCFC
Javascript Projects Source Code ➜ bit.ly/3gS2IWv
Website Builder Tool ➜ bit.ly/2JgaZ64
visit our blog 1bestcsharp.blogspot.com/
instagram: / 1bestcsharpblog
subscribe: goo.gl/nRjPKk
In This Javascript Tutorial we will See How To Calculate two Numbers ( Sum, Mutiplication, Division, Substraction )
Using Input Text, Button And Select Option For Math Operators In JS Using Netbeans Editor .
More Javascript Tutorials :
How to get value of selected radio button
• Javascript - How To Ge...
How to append Value to an array
• Javascript - How To Ap...
javascript images slider 1
• JS Images Slider - How...
Convert String To Number
• JavaScript - How To Co...
JavaScript Show And Hide Input Password Text
• JavaScript - How To Sh...
change div class name in js
• JavaScript - How To Ch...
using checkbox with js
• Javascript Checkbox - ...
get And Set Value To An Input
• Javascript - How To Ge...
Search Element In Array
• JavaScript - How To Se...
Add Search Remove Array Element
• JavaScript - How To Ad...
Add HTML Table Row
• Javascript - How To Ad...
Get Mouse Position
• Javascript - How To Ge...
Calculator:
• How To Make A Calculat...
share this video: • JavaScript Calculate 2...
#Javascript #Calculate #Addition #Subtraction #Multiplication #Division
----------- COURSES YOU MAY LIKE -----------
👉 Web Development Course: bit.ly/33eai4h
👉 Javascript Courses: bit.ly/35oYKwq
👉 Python Course: bit.ly/2XIdWlD
👉 React Course: bit.ly/2KQ7vrB
👉 PHP Course For Beginners: bit.ly/2GxRodb
👉 ASP.NET Course: bit.ly/2D8yR82
👉 Data Science Course: bit.ly/2Of3xL9
👉 Machine Learning Courses: bit.ly/2qHHBzh
👉 Full-stack .NET Developer Course: bit.ly/2OfooOB
👉 Docker Course: bit.ly/37wivnH

Опубликовано:

 

22 янв 2017

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 114   
@AutOdometer
@AutOdometer 6 лет назад
thank you thank you thank you!!! using something simple like this for my website to basically add horsepower inputs to create a combined horsepower page for someone to calculate horsepower if there were to MOD their car... thank you again! it worked!!!
@extraexplorer
@extraexplorer 2 года назад
Simple code but teached a lot of concepts.. Thanks 👍❤️
@rheyllcansico1677
@rheyllcansico1677 2 года назад
Thank you so much bro, I've been struggling for my assignment and i found your video thank you
@sujinlu738
@sujinlu738 3 года назад
thanks this finished the last part I was struggling on
@AidanNorde
@AidanNorde 4 года назад
thank you, this fixed a huuuge bug i had
@realtalkjames2408
@realtalkjames2408 4 года назад
Thanks a bunch lad, helpful !
@saurabhrawat5942
@saurabhrawat5942 2 года назад
Btw, this tutorial helps me a lot. I was confused a lot but then u came with this video to pull me out from that confusion and difficulty, thanks a lot. ❤️
@azma7md
@azma7md 6 лет назад
thank u ,u helped me alot
@bengalitablabeats6037
@bengalitablabeats6037 3 года назад
Thank you so much for making this video........... it really helped me a lot....
@MankeyMite
@MankeyMite 4 года назад
was trying to figure out why my code wasn't working for hours,, and the problem was a capital C in the word "calc" :)) happy it works now tho!
@hothanmohaet672
@hothanmohaet672 Год назад
Thank you man u solve my assignment ♥️♥️😅
@clement4386
@clement4386 4 года назад
Thanks a lot for your tutorial
@hazirahmuslim
@hazirahmuslim 3 года назад
Thanks! It worked! ^^
@tibormolnar2213
@tibormolnar2213 4 года назад
Thank you!
@rooticaa2842
@rooticaa2842 5 лет назад
Great Tutorial!! You saved my a** Thanks!!
@saitarun6562
@saitarun6562 5 лет назад
funny
@ayman1624
@ayman1624 Год назад
just what I needed thanks g
@tanaysambrani176
@tanaysambrani176 3 года назад
Thank you so much. Great tutorial 😍
@azizbraig1243
@azizbraig1243 5 лет назад
Thanks I like it
@MuhammadAslam-vb3se
@MuhammadAslam-vb3se 6 лет назад
hamasaaa khush rhooo ustaaad....
@abiramis2298
@abiramis2298 5 лет назад
Can we also make use of radio button instead of Dropbox ?will it work the same?
@carolinecarol5455
@carolinecarol5455 2 года назад
Thank you so mush!! very very good 🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙌🙌😀😀
@prottaybadhon8112
@prottaybadhon8112 5 лет назад
thanks a lot
@tinalee8686
@tinalee8686 3 года назад
Thanks a lot❤
@3ia14_dhamariogymnastiarno9
@3ia14_dhamariogymnastiarno9 5 лет назад
thanks it good job (y)
@KrishnaWyvern
@KrishnaWyvern 5 лет назад
Thanks bhai shukriya
@prasadmadushan
@prasadmadushan 5 лет назад
thanks a lot :)
@rajpandey7491
@rajpandey7491 5 лет назад
Thanks bro
@bass_by296
@bass_by296 6 месяцев назад
Perfect❗
@vimadanutalai1008
@vimadanutalai1008 Год назад
Thank you for concept .I’ll try this in my project ❤
@ChandanKumar-lj8go
@ChandanKumar-lj8go Месяц назад
Thanks you 👍
@chennaiahe8509
@chennaiahe8509 5 лет назад
Very good bro... but its would be better if u added the voice.
@Noor-gv8ec
@Noor-gv8ec 5 лет назад
There's no need to write an if statement. You can also add them on this way. Here's the code. function myFunction() { var x = parseInt(document.getElementById("b1").value); var y = parseInt(document.getElementById("b2").value); var z = x + y; document.getElementById("demo").innerHTML = z; }
@1BestCsharpblog
@1BestCsharpblog 5 лет назад
you need if statement to know what operation to do
@raul2484
@raul2484 3 года назад
THANK YOU SOOOOOOO MUCH MAN! THIS TUTORIAL IS THE POWERFUL ONE!!!! 😃😃😃😃😃😃😃😃😉😉😉😉😉😉😎😎😎😎😎😎
@codeAlongwith
@codeAlongwith 5 лет назад
Wow great! Would putting html elements around these such as divs have any impact?
@1BestCsharpblog
@1BestCsharpblog 5 лет назад
NO impact
@yayantar
@yayantar 2 года назад
Thanks !
@AhsanRaza-mx2ty
@AhsanRaza-mx2ty 5 лет назад
thank u
@uncuttricks4387
@uncuttricks4387 5 лет назад
i add 2 more values in your code but it's showing "" nul "" . is it compulsory to add all values ? . how to fix it
@abashraf6279
@abashraf6279 2 года назад
Thanks man
@Ventilatori57
@Ventilatori57 Год назад
Thanks mate! (y)
@HarishKumar-lw2ze
@HarishKumar-lw2ze 5 лет назад
plz add this type video : I have a four textbox. first i give one number in first box textbox and other textbox we have value , then remaining three textbox automatically decrease the value and show that textbox 0
@vipchhora7351
@vipchhora7351 2 года назад
Thanks
@lovestories701
@lovestories701 4 года назад
thanks sir
@boredcat8421
@boredcat8421 2 года назад
thank you
@digitaldata-surveying
@digitaldata-surveying 4 года назад
thanks
@nitinmaurya2269
@nitinmaurya2269 4 года назад
Aap kis text editor ka use krte ho?
@roshanzamry2589
@roshanzamry2589 2 года назад
thanks man
@LetsDoDifferent
@LetsDoDifferent 6 лет назад
Nice sir How add 2*3*8*5*3*5= CREATE please
@kazuma4643
@kazuma4643 2 года назад
thanks sir! but i want to know how to do (a+bi)*(c+di)?
@raheels.1068
@raheels.1068 5 лет назад
hi i look lot of videos but i cant find any thing which show how i can use code to add. id, code, then amount,date, update,delete. next page, if i want to know with code(serial number) how much amount have. or how many time i use this serial number serial number of a card. as bank card. but there is lot of cards. so if i want to know how many time i use it to add money or take out money.. can you make a example of this ? THANKS
@msann2060
@msann2060 4 года назад
Atlast i found thia now i can make my own calculator
@KURT-nw7eb
@KURT-nw7eb 4 года назад
Is there a way to do it without the button and only the select??
@onlineworkwear941
@onlineworkwear941 5 лет назад
How do you set n2 to be a fix numeric value? So for example if you wanted to calculate the price of something: n1(qty) x n2($2.50)
@1BestCsharpblog
@1BestCsharpblog 5 лет назад
you can add "readonly" to your input like this -- or use a span instead
@Depressso
@Depressso 2 года назад
Is there a way to make this in c#/wpf
@ManishaGupta-yu1sr
@ManishaGupta-yu1sr 6 лет назад
Nyc
@tanny_edits
@tanny_edits 4 года назад
can you please add buttons, instead of typing numbers , use buttons i hope you can do it
@madhavanmadhavan7786
@madhavanmadhavan7786 5 лет назад
whats happen when i give else part after the if part?
@erosveizi91
@erosveizi91 7 лет назад
Cant Understand only one thing and it looks very strange. If i save the result in a variable inside the function: var result=document.getElementById('result').value; result=num1+num2; the result wont show in its textbox. But if i write: var result=document.getElementById('result'); result.value=num1+num2; then everything is alright. Can you please explain me this???
@1BestCsharpblog
@1BestCsharpblog 7 лет назад
In " var result=document.getElementById('result').value; " the "result" have the value of the textbox [ Ex: 1,2,999, 2348.................. ] and in " var result=document.getElementById('result'); " the "result" have the reference of the textbox so you can set the value to the textbox using the "result" var (result.value=num1+num2;)
@Theelderscrollsftw94
@Theelderscrollsftw94 6 лет назад
Do you have the result outside the function? Because then it would be unable to pick up the variable, because if you write it inside, then it will ofcourse only count for inside the function and not out of it. Unsure of what's your problem as I cannot see the code.
@Atrophyiies
@Atrophyiies 5 лет назад
what do I do if I want add subtract to be buttons not a drop down? please help
@1BestCsharpblog
@1BestCsharpblog 5 лет назад
just add the code for subtract to the button onclick event
@sethlegaspi4336
@sethlegaspi4336 5 лет назад
Whats is the problem i input 5 and 3 and to multiply it became 15555???? What happened????
@YoungFuji-ct8hf
@YoungFuji-ct8hf 5 лет назад
Would a switch statement work with all this?
@spiderweb3324
@spiderweb3324 9 месяцев назад
off course it will work. He was made this with if else and on click function, you can do it with addEventListener grab value of operators and then with switch manipulate with numbers.
@dhananabimanto429
@dhananabimanto429 3 года назад
how to write square operation code?
@user-ri3im8vt5y
@user-ri3im8vt5y 3 месяца назад
Good. But why is there no sound???
@kevinsigue1207
@kevinsigue1207 6 лет назад
does this works if multiple dots(.) will be inputted? and how to make the dot appear only once?
@1BestCsharpblog
@1BestCsharpblog 6 лет назад
you need to check the text field already contains a dot watch this calculator tutorial to learn more ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-3Qt-wiMjV78.html
@kevinsigue1207
@kevinsigue1207 6 лет назад
thanks :D
@jyotsnawankhede8440
@jyotsnawankhede8440 5 лет назад
i wrote all the functions properly but it is not coming in internet explorer properly
@ezequiel_____
@ezequiel_____ 6 лет назад
What software you use ?
@1BestCsharpblog
@1BestCsharpblog 6 лет назад
netbeans
@justinpettit3432
@justinpettit3432 6 лет назад
Is it JavaScript they use for the fantasy football websites to add your points up and everything? If so do u know a vid that shows how u do that? If not do u know what they use to do that.
@1BestCsharpblog
@1BestCsharpblog 6 лет назад
no i don't know :(
@saurabhrawat5942
@saurabhrawat5942 2 года назад
Haven't u put any voice over in this video? Or my device gonna stop working properly...?
@sergeseveau6258
@sergeseveau6258 11 месяцев назад
could you please show me how to limit the answer to 2 decimal places - thank you in advance. 👍
@1BestCsharpblog
@1BestCsharpblog 11 месяцев назад
document.getElementById('result').value = calculationResult.toFixed(2);
@sergeseveau6258
@sergeseveau6258 11 месяцев назад
@@1BestCsharpblog WOW thank you so much - - but where do I put this statement (sorry for being so dumb)
@metkic94
@metkic94 4 года назад
Wont add decimal numbers that are bellow 1 , 0.5+0.5...
@jyotsnawankhede8440
@jyotsnawankhede8440 5 лет назад
please tell why it is not comming or tell othet methof
@jjkklls
@jjkklls 2 года назад
mine was works but the results just show for a sec. it doesnt show permanently, help me pls. Sorry for my bad english
@rahatmalik-dl9ue
@rahatmalik-dl9ue 3 года назад
Bro my code does not form a equal to sign
@1BestCsharpblog
@1BestCsharpblog 3 года назад
well it should be, are you puting the '=' in the right place?
@subhihokan556
@subhihokan556 6 лет назад
Hi I have a question. How i can do if I want the answer become blue and if negative answer become red ?
@hanan-aslam
@hanan-aslam 5 лет назад
:-D
@spiderweb3324
@spiderweb3324 9 месяцев назад
creating another class and add it to element, and when condition becomes true adding that class with style to that element.
@nannthithihein4591
@nannthithihein4591 8 месяцев назад
how to change result infinity to zero when 2/0
@youssefammi1436
@youssefammi1436 2 года назад
Switch is better than this or not
@user-zw2vv8xb7v
@user-zw2vv8xb7v 3 года назад
0:43
@b5etcraft
@b5etcraft 4 года назад
how can i take any number of inputs ? how can i create array in HTTML ?
@EldenSoulsVids
@EldenSoulsVids 4 года назад
mine wasnt working right because i put the script section in the body instead of the head in case anyone else did that lol
@VikramVikram-zr7xk
@VikramVikram-zr7xk 6 лет назад
Sir output is not shown. What can I do
@1BestCsharpblog
@1BestCsharpblog 6 лет назад
1 - find the problem 2 - fix the problem 3 - source code link in the description
@anjuvishwas309
@anjuvishwas309 2 года назад
@@1BestCsharpblog I tried and everything is correct but still I can't see the result
@shiaclark3067
@shiaclark3067 4 года назад
does not work for me at all
@jbruce87
@jbruce87 2 года назад
Lol, all these unanswered questions
@rayhanulislam4104
@rayhanulislam4104 5 лет назад
It doesn't work
@uncuttricks4387
@uncuttricks4387 5 лет назад
bhai iska kasa banega ? Example a+b+c+d = e e+ f= g
@rohithawijethunga995
@rohithawijethunga995 2 года назад
Thank you !
@TheRealRaynex
@TheRealRaynex 2 года назад
thank you
Далее
FOOLED THE GUARD🤢
00:54
Просмотров 11 млн
СКОЛЬКО МОИХ ТРЕКОВ ТЫ ЗНАЕШЬ?
00:41
#26 Form Validations in JavaScript
12:25
Просмотров 498 тыс.
Javascript, how to get input text value while typing
0:43