I have a checkbox element with the ID "fullscreen." Clicking the checkbox puts the user into fullscreen mode. However, if the user exits the fullscreen mode using f11, the checkbox remains checked.
I am looking for a script which does as follows:
If the checkbox "fullscreen" is checked, and an "onfullscreenchange" event occurs
Then, uncheck checkbox with the ID "fullscreen."
This is what I have right now: It does not work--
var el = document.getElementById('fullscreen');
if (el.checked == true){
document.onfullscreenchange = function ( event ) {
el.checked = false;
};
}) );
How do I do this? Please help!