Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

How can i dynamically display javascript content

I am very new to javascript. My goal is to convert my excel sheet into javascript. I want to forecast preventive maintenance and display running hours and maintenance kits. if somebody could point me in the right direction would be appreciated.

I am calculating: daily running hours (max. 24 hours) multiplied by years(max 5 years). The result = total running hours. I want to display the running hours and kits dynamically. For better understanding of my goal, please see below screenshot from my excel sheet.preventive maintenance. I also included a screenshot of the maintenance hours as the maintenance kits are repeated on certain hours. maintenance kits

I prepared a fiddle where i started with the simple hour calculation. How can i display the maintenance hours and kits dynamically depending on total hours?

    $(document).ready(function() {
$(".calculate").click(function() {
    var d = $('input[name="duty"]').val();
    var y = $('input[name="year"]').val();
    var total = d * y * 365;
    $('.result').val(total);

    var a1 = 1000;
    var ab1 = 2000;
    var abc1 = 4000;
    var abcd1 = 16000;
    var abcde1 = 32000;
});
});

I just would need a pointer in the right direction please.

Best regards Pascal

Comments