I am trying to make additions or multiplications on my web site using wix code. I am an absolute beginner in this using infos got on youtube but I got error on the value part of the code I did (see below). Could you please show me what to do to make this code work!
// For full API documentation, including code examples, visit http://wix.to/94BuAAs $w.onReady(function () { //#labaguettefrancaise }); let kgdefarine = Number($w("#kgdefarine"),value); let Qparpain = Number($w("#Qparpain"),value); let nbredepaindropdown = Number($w("#nbredepaindropdown"),value); { // Add Qparpain = kgdefarine / 4.86; console.log(Qparpain); } Thank in advance for all the help
Stanley
you seem to be using commas in front ",value" instead of ".value"
You need a function such as a Button's onClick event to do the calculation.
Below I have a Button with an id calculate
export function calculate_click(event) { let value = Number($w('#input1').value) * Number($w("#input2").value); console.log(value); }
The above function multiplies #input1 & #input2 and produces the result in the console.