Skip to content
Advertisement

Tag: function

Duplicate fields in a form upon selection

I made a form to select skills. After the 1st selection is made, a 2nd list is shown with options depending of the 1st choice. Then, a “+” button allow to duplicate the fields ans add another skill. My problem : The inital form is OK but when I press “+” the second form created doesn’t work (the second “select

Why can’t i output outside a function, in this scenario where i’m creating a simple counter i’m confused as to why it’s working inside and not out?

Why can’t I output outside the function here, why does it need to be inside? Answer Because if it were where you’ve shown in the question, the value would be 0. The code runs immediately on page load, it doesn’t wait for something to call countJar. Where it is now, it doesn’t run until countJar is called. If you mean

trouble multiplying in JavaScript

So what I am trying to do here in JavaScript is find out is i want to order more candy or not. So far I compare the in Stock to the weekly average and if in Stock is < weekly average I will order 2 times the weekly Average. However, if the is greater than in Stock then i will

Advertisement