开发者

jquery .val punctuation?

开发者 https://www.devze.com 2023-03-13 16:38 出处:网络
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?

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

精彩评论

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