I need to run the below javascript code on any name that begins with text-15. Here is my beginning code that runs with text-15. But I need it to run when the value changes to something like text-15-18764juv and this value may change to something else. So a wildcard: text-15*
Can someone help? Thanks
JavaScript:
<script type="text/javascript">
$(document).ready(function() {
$("#text-15").keypress(function (e) {
if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
do something;
return false;
} else {
do something;
}
});
});
</script>
Can someone help? Thanks