diff --git a/html.tpl.php b/html.tpl.php
index ce0fb9a..4218186 100644
--- a/html.tpl.php
+++ b/html.tpl.php
@@ -15,6 +15,11 @@
  *   The file contains the html5shiv, innerShiv, an a modified version of
  *   Drupal.ajax.prototype.commands.insert to process html5 elements added on the
  *   page via drupal ajax.
+ * - $html_attributes: String of attributes for the html element. It can be
+ *   manipulated through the variable $html_attributes_array from preprocess
+ *   functions.
+ * - $html_attributes_array: Array of html attribute values. It is flattened
+ *   into a string within the variable $html_attributes.
  *
  * Core Variables:
  * - $css: An array of CSS files for the current page.
@@ -50,7 +55,7 @@
  * @see html5_tools_process_html()
  */
 ?><!doctype html<?php print $rdf_header; ?>>
-<html lang="<?php print $language->language; ?>" dir="<?php print $language->dir; ?>"<?php print $rdf_namespaces; ?>>
+<html lang="<?php print $language->language; ?>" dir="<?php print $language->dir; ?>"<?php print $rdf_namespaces; ?><?php print $html_attributes; ?>>
 <head<?php print $rdf_profile?>>
   <?php print $head; ?>
   <title><?php print $head_title; ?></title>
diff --git a/html5_tools.module b/html5_tools.module
index 7a4ddd9..2cf7283 100644
--- a/html5_tools.module
+++ b/html5_tools.module
@@ -243,6 +243,7 @@ function html5_tools_theme_registry_alter(&$theme_registry) {
 function html5_tools_process_html(&$variables) {
   $variables['rdf_header'] = '';
   $variables['rdf_profile'] = '';
+  $variables['html_attributes'] = '';
   // Support RDF is it's enabled.
   if (module_exists('rdf')) {
     $variables['rdf_header'] = ' PUBLIC "-//W3C//DTD HTML+RDFa 1.1//EN"';
@@ -267,6 +268,11 @@ function html5_tools_process_html(&$variables) {
   $script = theme('html_tag', $element);
   // I really want to keep the mark-up clean, which is why I added the \n
   $variables['html5shiv'] = "\n<!--[if lt IE 9]>\n" . $script . "<![endif]-->\n";
+
+  // Add support for multiple extra html attributes.
+  if (!empty($variables['html_attributes_array'])) {
+    $variables['html_attributes'] = drupal_attributes($variables['html_attributes_array']);
+  }
 }
 
 /**
