This is a page witch i am about to make it upload a image but when i select the element by id in javascript the browser say 'Cannot set proprety "onchange" of null' But i wrote the exact same id please help this is my code
<!DOCTYPE html>
<html>
<head>
<title>Register</title>
<link href='http://fonts.googleapis.com/css?family=Arvo:400,700|Ubuntu:300,400,500,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="/css/style.css"/>
<script>
function _(id){
return document.getElementById(id);
}
_("file_upload").onchange = function() {
alert("It works!"); };
</script>
</head>
<body>
<div id="container">
<div id="half1">
<div id="upload">
<div id="user">
<img src="/img/1.png" alt="User image"/>
</div>
<img src="/img/plus.png" alt="Upload" />
<input type="file" id="file_upload"/>
</div>
</div>
</div>
</body>