Encountering issues with dynamic elements.
When I click a button, the following JS function is executed. It displays a stylish CSS alert upon postback and then runs the function.
function scrollToTop(sender, args) {
window.scrollTo(0, 0);
document.getElementById("wait").innerHTML = "<br/><div class='alert-box notice' id='spinner' ><span>Validating : </span>One moment please.</div>";
$('#spinner').css("background-image", "url(images/ajax.gif)");
}
The intention is to change the background image to ajax.gif (spinner), but the ajax.gif doesn't display unless you add "return false;" on the button onClick.
Why doesn't jQuery update images dynamically? I even tried using vanilla JavaScript, but encountered the same issue.