Hi folks I apologize if you have seen this one but after some extensive google searches I still came out empty. I want to use global JavaScript variables in my visualforce page but only local variables work. What am I missing? Thanks for helping a newbie.
Basic example:
//Variables
var resch = document.getElementById('resapp');
var step1 = document.getElementById('firstpage');
function scheduleNow (){
if(resch.checked)
{
step1.style.display='none';
alert("You chose to reschedule.");
}
window.addEventListener('DOMContentLoaded', function() { ... });as this makes sure that all of the DOM elements are loaded before your code executes.