mode can be set via html attrib