How would you write the statement bellow, that is JavaScript imbedded in HTML into normal JavaScript that would be written into a file? I am making a toggle switch, and I want to have the toggle after being clicked and going through the transformation go to a new file page. To make this possible I need to know the non-imbedded version of the function. This is what it is:
<div class="statement">Slide to Play!</div>
<div class="container">
<div class="play" onclick= "this.classId.toggle('active')">
<div class="inner-square"></div>
</div></div>
And in JavaScript this is what I have that doesn't work:
const transition = document.querySelector('play');
Promise.all(
document.getElementById("play").onclick = function() {
transition.addEventListener('transitionend', () => {
console.log('Transition ended');
location.assign("gamepage.html")
}
);
Promise.all(
})
).then(transition.addEventListener('transitionend', () => {
console.log('Transition ended');location.assign("gamepage.html")});