Helper to get data from dom element.