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());
});
});
精彩评论