If I have an input with class 'textInputs' and have a paste function for those elements, I need to nest a setTimeout function inside the paste event function, but then how can I define this
inside the timeout function? The code below does not work as this
is not defined inside the setTimeout function. Thank you.
$('.textInputs').on('paste',function() {
var element = this;
window.setTimeout(function() {
newstr = element.value.replace(/\n/g, '');
$(this).val(newstr);
},100);
});