how to get the width on resized element in javascript code example Example: javascript resize event window.resize = event => { // Code here };