Here is my jQuery at the bottom of html page:
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript">
$(document).ready(function () {
$('#login').click(function() {
var co_id = $('#companies').val();
console.log(co_id);
});
});
</script>
When I type this jQuery into the console, then type co_id
it works, but when I run this in browser and choose a company and click the correct button, and I would assume when I type co_id
into chrome browser console, it would show my option value? But it is coming back as:
>co_id
ReferenceError: co_id is not defined
Here is html:
<select name="" id="companies">
<option value="--">--</option>
<option value="1">Company</option>
<option value="2">Company2</option>
<option value="3">Company3</option>
<option value="68">Company4</option>
<option value="69">Company5</option>
<option value="70">Company6</option>
</select><input id="login" type="submit" value="Login">