₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,067 members, 8,420,147 topics. Date: Thursday, 04 June 2026 at 12:12 PM

Toggle theme

Need Help With This Javascript - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingNeed Help With This Javascript (938 Views)

1 Reply (Go Down)

Need Help With This Javascript by exhibit7432(op): 8:01pm On Feb 24, 2020
I need to know how to achieve what’s in the picture. A situation where which when the user clicks on the plus or minus sign or updates the text area.

The amount is incremented 50 times the number in the text area.

Please it’s urgent

Re: Need Help With This Javascript by telad(m): 8:08pm On Feb 24, 2020
your explanation isn't clear enough, if the number is multiplied by 50 when u press the + sign. What happens to the number when u press the - sign?
Re: Need Help With This Javascript by exhibit7432(op): 8:38pm On Feb 24, 2020
When you press the minus sign whatever number there should still be multiplied by 50. To give the total amount.

Each unit costs 50 Naira.

So whichever amount of units that are in the input text box should be multiplied by 50 and displayed there.
Re: Need Help With This Javascript by resosdigital(m): 9:54pm On Feb 24, 2020
Add a click event listener to the button and update the value of the text area withh it's current value * 50.
Re: Need Help With This Javascript by exhibit7432(op): 10:33pm On Feb 24, 2020
Please can you give me the exact code for that. Thank you
Re: Need Help With This Javascript by Karleb(m): 10:45pm On Feb 24, 2020
Let me try.

On the button add click event to it:

onclick="addFifty()"

On the amount HTML tag, add an id of "add":

id="add".

On your script tag, write this:

<Script>
Var add = document.getElementById("add" ) .value;

function addFifty (){

Var result = add + 50;

document.getElementById("add" ) .value = result;

}

This should work.


</Script>
1 Reply

HELP With This Javascript ProblemCan Someone Help Me With With This Javascript Exercise PleaseHelp Me With This Javascript Problem234

Don't Just Learn Programming practice Programming (JOIN THE BUS)Static Travel Website Created With Html Css And JavascriptHelp Needed On C