cara menonaktifkan formulir input saat memilih perubahan

<select id="menu">
    <option value="0">News</option>
    <option value="1">Friends</option>
    <option value="2">Other</option>
</select>

<input id="comment" type="text" disabled="true" />

<script>
  document.getElementById('menu').addEventListener('change', function() {
    if (this.value == 2) {
        document.getElementById('comment').disabled = false;
    } else {
        document.getElementById('comment').disabled = true;
    }
});
</script>
Alif Annas