This is my third question on the subject. For reasons I won’t go into, I cannot use jquery on the site I am working on. How would you suggest I translate this block of code into pure Javascript:
<script>
$(document).ready(function(){
$('#rule-type').change(function() {
var val = $(this).val();
if (val == 'tid and acc') {
$('#tid-acc').show();
}
else {
$('#tid-acc').hide();
}
});
});
</script>
<select id="rule-type">
<option value="" selected="selected">None</option>
<option value="tid">tid</option>
<option value="tid and acc">tid and acc</option>
<option value="xid">xid</option>
</select>
<input id="tid-acc">
Thanks in advance! Here is a link to jfiddle: http://jsfiddle.net/Wx8Jf/2/
Fiddle: http://jsfiddle.net/Wx8Jf/12/