I'm attempting to have a hidden div tag display when highlighting specific text. I was able to get a hidden div to display on highlighting but the 2 parts I cannot accomplish are:
Only show when highlighting specific text (I assume using a span tag id or something similar)
After the display has been changed to block, change it back to hidden after 5 seconds.
Here is my attempt. Again, this does show the hidden div on highlighting but that's as far as I got. Please help!
function ShowNote() {
document.getElementById('Note').style.display = 'block';
}
document.onmouseup = ShowNote;
if (!document.all) document.captureEvents(Event.MOUSEUP);
function HideNote() {
document.getElementById('Note').style.display = 'hidden';
}
setTimeout("HideNote()", 5000); // after 5 secs
I DON'T want it to show when I highlight this text
<br />I DO want it to show when I highlight this text.
<div type='text' id='Note' style="display:none;">HIDDEN DIV CONTENT</div>