added a method to HtmlElement to encapsulate the dom element