I have no idea why this function keeps saying it is undefined. I'm trying to call it onchange on a tag and i'm trying to check if the value being called into the function is the value of the selected option. This is an extremely simple html page so I have no idea why this error would pop up? Can anybody tell me what's wrong with this code?
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Dog Decider</title>
<script src="data.js">
function buildSelect(dom){
console.log(dom);
}
</script>
</head>
<body>
<h1>Welcome to Dog Decider!</h1>
<p>Are you looking for a small or large dog?</p>
<select name="first" onchange="buildSelect(this);">
<option value="none">-- Select Dog Size --</option>
<option value="Small">Small</option>
<option value="Large">Large</option>
</select>
</body>
</html>
Originally the function was bigger and actually implemented data.js, but I tore it all down to try and discover the root of this problem...