I just allow someone to enter data in the form of numbers. If the data entered in the form of a mixture, the numbers and text, the text will be deleted.
However, I use jQuery which is not true. It turns out that removed precisely both the numbers and text.
The following code
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<div id="test">0123456789text</div>
<script>
if ($('#test').html()!="0123456789"){
$('#test').remove();
}
</script>
How do I fix it?
Note:
I do not have access to edit the <input>
or <textarea>
on the form