In following code I want to have disabled text input if select option value is 0. What's wrong?
$('select').change(function() {
if ($(this).val() == 0)) (".xyz").attr('disabled',true);
}).change();
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<select id="type">
<option value="0"></option>
<option value="1">1</option>
<option value="2">2</option>
</select>
<br />
<input type="text" class="xyz" name="xyz" />