Generalize setAutoBodyClass to setAutoContextClass, for any DOM element