<script>
document.addEventListener("DOMContentLoaded", function() {
(function () {
const rangeElements = document.querySelectorAll('.uc-percent-calc input.t-range');
rangeElements.forEach(function (el, index) {
el.addEventListener('input',function(e) {
const ngy = +document.querySelector('.uc-percent-calc input[name="ngy"]').value;
const percent = document.querySelector('.uc-percent-calc input[name="percent"]');
let correction = 0;
if(ngy>5) correction = 0.02;
percent.value = correction;
});
});
})();
});
</script>
<style>
input[name="percent"]{display:none}
</style>