Pure JS dom element resizing