Javascript blocking all events

hey everyone, its yaboi with another problem over here: (sorry for messy code)

Question:
why does this javascript event (located furthest down in the code) make all other events permanently stop working
(might need to look through the entire event as i have no idea whats going on)

document.getElementById("launch_btn").addEventListener("click", function() {

Repl link:
https://replit.com/@DiceBunny/website-test?v=1#src/main.rs

found the problem in this line, i suspect it to be something about it overriding a however i have no idea, i just read that a few hours ago

document.body.innerHTML += '<img src="src/images/loading.gif" style="width: 100px; height: 100px; transform: translate(-50%, -50%); top: 10%; left: 50%; position: fixed; z-index: 2000" id="loading_gif">';

had to change it from

document.body.innerHTML += '<img src="src/images/loading.gif" style="width: 100px; height: 100px; transform: translate(-50%, -50%); top: 10%; left: 50%; position: fixed; z-index: 2000" id="loading_gif">';

to

    var img = document.createElement('img');
    img.src = "src/images/loading.gif";
    img.style.width = '100px';
    img.style.height = '100px';
    img.style.transform = 'translate(-50%, -50%)';
    img.style.top = '10%';
    img.style.left = '50%';
    img.style.position = 'fixed';
    img.style.zIndex = '2000';
    img.id = 'loading_gif';

    document.body.appendChild(img);
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.