Here is a simple bit of HTML and vanilla JS. When I call this page on it’s own it works fine as expected.
When I use fetch and embed the page on another page it doesn’t fire and I have no errors?
Why?
“`
<form id=”settings”>
<h4 id=”rangeValue”>0</h4>
<input type=”range” class=”range” name=”” value=”0″ min=”0″ max=”100″ onchange=”rangeSlider(this.value);”>
<h4 id=”rangeValue2″>0</h4>
<input type=”range” class=”range” name=”” value=”0″ min=”0″ max=”100″ onchange=”rangeSlider2(this.value);”>
<input type=”submit” id=”savesettings” name=”” value=”Save Settings”>
</form>
<script>
document.getElementById(“savesettings”).addEventListener(“click”, function(e){
e.preventDefault();
console.log(‘Save’);
});
</script>