<p>I am building a menu in HTML/CSS/JS and I need a way to prevent the text in the menu from being highlighted when double-clicked on. I need a way to pass the id's of several divs into a function and have highlighting turned off within them. </p>

<p>So when the user accidentally (or on purpose) double clicks on the menu, the menu shows its sub-elements but its text does not highlight.</p>

<p>There are a number of scripts out there floating around on the web, but many seem outdated. What's the best way?</p>

You could:
Give it ("it" being your text) a onclick event
First click sets a variable to the current time
Second click checks to see if that variable is x time from the current, current time (so a double click over, for example, 500ms, doesn't register as a double click)
If it
is
a double click, do something to the page like adding hidden HTML, doing document.focus(). You'll have to experiment with these as some might cause unwanted scrolling.