I need to use jquery 1.3.2 and would like to check if a string inside element contains a number. If not an alert should popup. Here is my code but it does not work. What is wrong with it? thank you
$(document).ready(function () {
var val = $(".xxx").val();
var matches = val.match(/\d+/g);
if (matches != null) {
alert('number');
}
});
html
<div class="xxx">aaa</div>