I have written the following (working) javascript
function calc(A,B,SUM) {
var one = Number(A);
var two = Number(document.getElementById(B).value);
if (isNaN(one)) { alert('Invalid entry: '+A); one=0; }
if (isNaN(two)) { alert('Invalid entry: '+B); two=0; }
document.getElementById(SUM).value = (one/(((two*0.6)/2.4)/12))*100;
}
However, I need to convert it to jquery to work with Wordpress. I have a .js file properly enqueued.
Everything I do just creates errors. What resources are out there to explain how to convert it to jquery and how to make they jquery work in wordpress?