Disabling text selection
by Mike Stenhouse on May 11 2006, 13:03
While trying to make a table behave in an Excel fashion I came across a little problem. I wanted the table to allow the user to select a range of rows with a Shift+Click… The problem is that, by default, the browser will select the page’s text content. This isn’t something you’ll want to do very often but it is possible to get around this:
Firefox can do this from your CSS:
table {
-moz-user-select: none;
}
On the table element IE needs:
the_table_node.onselectstart = function () {
return false;
};
Comments
by Jeromie Walters on April 22 2009, 16:02 #