d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Iso Help With Html And Js Files
Add Reply New Topic New Poll
Member
Posts: 250
Joined: Mar 1 2023
Gold: 271.00
Mar 12 2023 08:40pm
Needing help getting this code to run!





Member
Posts: 22,237
Joined: Dec 6 2008
Gold: 2,971.74
Trader: Mediator
Mar 14 2023 07:32am
What error are you getting?
Member
Posts: 6,554
Joined: Feb 7 2018
Gold: 36.00
Mar 14 2023 01:36pm
Unsure what you're HTML looks like, but the javascript is fine

I assume you're not calling the function somewhere?

Heres a working example which calls the function inside a form: https://codepen.io/Jaromme/pen/poOLYoG

This post was edited by Strickland on Mar 14 2023 01:37pm
Member
Posts: 1,367
Joined: Aug 11 2019
Gold: 91,307.78
May 26 2023 01:14pm
Why is calculate tip inside your function load? This is probably wrong.

As for serviceQuality this should be a select box so it enforces the 3 choices then you wante document.GetElemetById("serviceQuality").selected instead of value iirc
and last but not least you need to make sure your function is triggered by the button

<button onclick="calculateTip()">Tip</button>

Can DM me directly if need a quicker response lol.

This post was edited by voidqueen on May 26 2023 01:15pm
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll