Use selected item's width

Item width could be: without limit, with specific limit, or limit if width > specific limit.
element.setAttribute('width','auto') doesn't change width.
element.style.width = 'auto' does the change.