开发者

jquery .val punctuation?

I am using .val() to get the value of an input field however when I type in characters like ; it doesn't seem to get the value, is there an issue with punctuation and how can I solve it?

开发者_StackOverflowThanks!


Works for me, here is demo: http://jsfiddle.net/bpegp/, you have some bug somewhere else...


This definitely works regardless of what characters you put in the textbox, there must be a problem somewhere else?

<input id="something" type="text" value="" />
<input type="button" id="btn" value="Go" />

$(document).ready(function(){
 $('#btn').click(function(){
  alert($('#something').val());
 });
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜