<input type="text" id="name"/>
谢谢..
if ($('#name').val().indexOf(',') !== -1) { alert('There was a comma'); }
正如您未指定的那样,您可以将该代码置于模糊事件等中.