I need help with writing Javascript code that will change the width of a div element called "red" from 100% to 1000px when the browser width is less than 1000px. The code should revert the width back to 100% when the browser width is greater than 1000px. I am focused on learning pure Javascript without relying on JQuery. I have found many JQuery solutions, but I want to master Javascript first. The reason I want to change the "red" div element is because min-width: 1000px; is not supported in Internet Explorer. Any assistance or guidance on this matter is greatly appreciated. Please check out this JSFiddle link for reference.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Positioning</title>
<style type="text/css">
#red {position: absolute; margin-top: 100px; width: 100%; min-width: 1000px; height: 400px; background-color: red;}
#contents {position: relative; top: 10px; width: 1000px; height: 600px; margin: 0px auto; border: 1px solid white;}
html, body, div {margin: 0; padding: 0; border: 0;}
</style>
</head>
<body style="background-color: black;">
<div id="red"></div>
<div id="contents"></div>
</body>
</html>