I have code like below but i am getting syntax error in 'onkeyup' function..
$('#file_lists').append('<div class="custom_text"><input type="text" onkeyup="this.value=this.value.replace(/[^1-9]/g,'');" name="custom_time" id="'+rands+'" value="1"></div>').after($("#final_result"));
please suggest me how to use this function.
$('#file_lists').append('<div class="custom_text"><input type="text" onkeyup="this.value=this.value.replace(/[^1-9]/g,\'\');" name="custom_time" id="' + rands + '" value="1"></div>').after($("#final_result"));''in the middle of the string literal specified with single (') quotes. The parser thinks the string ends there and another begins. You need to escape those characters like Rayon did:\'.