Range slider "oninput"

Hey all, I have some code for a calculator and part of that JS has “oninput” but Webflow has that as a reserved term on attributes.
Is there a way to set that on the range slide from attributes at all?

Code for ref:

function calculateROI() {
const costPerLead = 299;
const households = document.getElementById(‘households’).value;
const conversion = document.getElementById(‘conversion’).value / 100;
const closed = document.getElementById(‘closed’).value / 100;
const clientValue = document.getElementById(‘clientValue’).value;

// Update displayed values on sliders
document.getElementById('householdsValue').textContent = households;
document.getElementById('conversionValue').textContent = Math.round(conversion * 100);
document.getElementById('closedValue').textContent = Math.round(closed * 100);
document.getElementById('clientValueValue').textContent = clientValue;

// Calculate total revenue and total cost
const totalRevenue = households * conversion * closed * clientValue;
const totalCost = costPerLead * households;

// Calculate ROI as a multiplier
let roi = totalRevenue / totalCost;

// Ensure ROI has a minimum value of 5x
if (roi < 5) {
    roi = 5;
}

// Update display for ROI and Revenue Generated
document.getElementById('roiResult').textContent = roi.toFixed(2) + 'x';
document.getElementById('revenueResult').textContent = totalRevenue.toFixed(2);

}

// Ensure ROI is calculated when page is loaded
window.onload = calculateROI; // Calculate initial ROI when page loads

Hey @Ohana_Studio!

Could you share a link to the project? And a loom on the issue? We can modify the code according to the wanted functionality :slight_smile: