Let me explain what I did:
I had this code in this question (due to other reasons):
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:complete',function() {
// Identify this question
var thisQuestion = $('#question{QID}');
// First column
$('td.answer-item:nth-child(2) input:text', thisQuestion).attr('size', 200);
// Second column
$('td.answer-item:nth-child(3) input:text', thisQuestion).attr('size', 4);
});
</script>
I added the code:
if($.isNumeric(thisValue) === false) {
// Strip out non-numerics characters
newValue = thisValue.replace(/\D/g,'');
$(this).val(newValue).trigger('change');
}
After
$('td.answer-item:nth-child(3) input:text', thisQuestion).attr('size', 4);
But it didn't work
What is wrong?
Sorry if the question is stupid