W3C home > Mailing lists > Public > www-validator@w3.org > October 2012

Re: onselectstart attribute on <div> element

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Sun, 21 Oct 2012 00:27:15 +0300
Message-ID: <50831733.7090309@cs.tut.fi>
To: Dark Water <darkwater124@gmail.com>
CC: www-validator@w3.org
2012-10-18 16:55, Dark Water wrote:

> I checked one of my website's pages
> (http://www.novaember.com/servers/minecraft/) with the W3C Markup
> Validator. It said that attribute onselectstart isn't allowed on a <div>
> element. I think this is incorrect as it's a Javascript event and should
> be applicable to <div> elements.
> Am I correct?

The onselectstart attribute is not part of HTML5, which is the version 
of HTML you are effectively declaring - and other published versions of 
HTML have smaller sets of allowed event attributes (on...).

Note that the attribute, and the corresponding DOM property, is an IE 
invention and not necessarily supported by other browsers. For a 
discussion of ways to simulate it in other browsers, see e.g.

(The attribute is probably most often used in attempts at preventing 
copying of web page content with cut & paste. Though it does not 
effectively prevent anything (the user can always disable JavaScript), 
it tends to act as a signal: the content is not worth copying.)

Received on Saturday, 20 October 2012 21:27:58 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:18:07 UTC