に文字列を比較するので、jQueryのjQueryのは、私のような文字列比較を実行しようとしていた入力値
$('#select_directory_type').on('change', function() {
window.alert($(this).val()); // I can see the selection is "SOMETHING"
if("SOMETHING" === $(this).val()){
// Never gets executed even when the selection is "SOMETHING".
} });
にもう一つの問題は、
$this.val()
and
$(this).val()
感謝の違いは何であるか、です!
これは、質問と回答の検索可能なインデックスです。一度に1つの質問をしてください。 –
'$ this'は定義されていません。 DOM構文について話しているなら 'this.value'が必要です。そうでなければ' var $ this = $(this);;を明示的に定義する必要があります –
あなたの壊れたコードの例を入れてください。 –