get window object of the element. fixes #644