Switch from a global variable to a data-* atribute on the document element.