Javascript/jQuery:
$(document).ready(function () { $(\'#txt\').bind(\"paste\", function (e) { var $this = $(this); $
Call the function onchange event of Textbox as, instead of document.ready:
change
document.ready
HTML
JQuery
function onlyNum() { var $this = $('#txt'); $this.val($this.val().replace(/\D/g, '')); }