How would I go about playing some sort of a sound using jQuery only when the user is on another tab/window in their browser or their browser is minimized.... Im sure it will include something similar to: $('body').append('<embed src="/path/to/your/sound.wav" autostart="true" hidden="true" loop="false">'); Code (markup): But Im unfamiliar with the function, if there is one to only execute if not "top"...