For more information, questions, or comments email us at info (at) electricbikeexplorer.com
(function(){
function badge(msg){
var box = document.getElementById("motor-power-calculator");
if(!box) return;
var el = document.createElement("div");
el.style.padding = "10px";
el.style.borderRadius = "10px";
el.style.margin = "10px 0";
el.style.background = "#E9F5EC";
el.style.border = "1px solid #4CAF6A";
el.style.color = "#1F3D2B";
el.style.fontWeight = "700";
el.textContent = msg;
box.prepend(el);
}
document.addEventListener("DOMContentLoaded", function(){
var wrap = document.getElementById("motor-power-calculator");
if(!wrap){
// JS loaded, but calculator isn't on this page OR IDs changed
return;
}
var btn = document.getElementById("mpc-calcBtn");
if(!btn){
badge("Motor Power JS loaded, but I cannot find the Calculate button (mpc-calcBtn). This is an ID mismatch or duplicate IDs.");
return;
}
badge("Motor Power JS loaded and found the calculator. Click Calculate now.");
btn.addEventListener("click", function(){
alert("Click handler is attached. If results still donβt change, the issue is inside the calculation code.");
});
});
})();