/    Sign up×
Community /Pin to ProfileBookmark

Why wont this event fire?

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>
“`

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@JMRKERJun 26.2020 — Where do you include the code for "rangeSlider2"?
Copy linkTweet thisAlerts:
@daveyerwinJun 26.2020 — please show us the page where you

"use fetch and embed"
Copy linkTweet thisAlerts:
@VITSUSAJun 30.2020 — I agree with JMRKER and DaveyErwin, have you tried to implement both things?
×

Success!

Help @kiwis spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...