Changing iframe src with Javascript

In this case, it’s probably because you are using the wrong brackets here:

document.getElementById['calendar'].src = loc;

should be

document.getElementById('calendar').src = loc;

Leave a Comment