Search code examples
javascriptfirefoxhighlighting

stopping firefox from selecting content on webpage


Possible Duplicate:
What is the best way to prevent highlighting of text when clicking on its containing div in javascript?

When a user clicks and drags how do you stop firefox from highlighting your content?


Solution

  • This has already been answered here: What is the best way to prevent highlighting of text when clicking on its containing div in javascript?

    Basically, for firefox, you should be able to do this in CSS:

    div.noSelect {
      -moz-user-select: none;//mozilla browsers
      -khtml-user-select: none;//webkit browsers
    }
    

    For IE you can apparently "add a handler to the ondragstart event, and return false;"