キャッチされない例外TypeErrorない.search $(この):$(この)あなたが入力中の文字を検索したい場合は、機能キャッチされない例外TypeError:機能
$(document).ready(function(){
$('#caption').on('keypress', function() {
var n = $(this).search('#');
if(n != "-1"){
window.alert("There's a hash");
}else{
window.alert("There's not a hash");
}
});
});
あなたは 'find'が必要です! –
'#caption'とは何ですか?どのように'# 'を探していますか?値、HTML、または属性ですか? – 4castle
#はtextareaの値です – Linuxe