Visual Studio highlighted my onresize attribute of my div tag, and says that it isn\'t a valid attribute for HTML5. Is this true? What should I use
Microsoft's Internet Explorer supports onresize on all HTML elements.
In all other Browsers the onresize is only available at the window object.
https://developer.mozilla.org/en-US/docs/Web/API/Window.onresize
If you wanna have onresize at a div in all browsers check this:
http://marcj.github.io/css-element-queries/
This library has a class ResizeSensor which can be used for resize detection.