<script> window.onbeforeunload = function(e){ document.getElementById('idOfElementToChange').className = 'classAddedAfterClick'; } </script>
Pretty self-explanatory. Replace idOfElementToChange with the ID of the element that will incur the new class. And ClassAddedAfterClick is the new class that will be added. Probably didn't need to say this.
Comments