I need help calling my function, it is not recognizing it and i cannot see why? Any answers to why this is not working…thanks
Broken
<script type='text/javascript'>
$('select').change(function() {
alert("hi");
var op =$(this).val();
if(op !='') {
$('input[name="processor_details"]').prop('disabled',false);
} else {
$('input[name="processor_details"]').prop('disabled', true);
}
});
</script>
</head>
<body>
<div>
<strong>Processor:</strong>
<select class="custom-pc" name="processor" id="processor">
<option value=""></option>
<option value="1">1</option>
<option value="1">2</option>
<option value="3">3</option>
</select>
<input name="processor_details" type="button" value="Details" disabled="true" />
</div>
</body>
</html>
You script not see the
selectbecause it’s below script itself. You can put your script below select or wrap it with$(document).ready()