I am attempting to conditionally enable or disable HTML input based on the value of a variable. The "disable" part is working well, but the "enable" isn't, and I can't figure out why.
The code:
<--if variable is true...-->
<div id="disabledSearch" class="searchBox disabled">
<script type="text/javascript">
$('#disabledSearch :input').attr('disabled', true);
</script>
<--if variable is false-->
<div id="enabledSearch" class="searchBox">
<script type="text/javascript">
//This line isn't working:
$('#enabledSearch :input').removeAttr('disabled');
</script>