i am aiming to remove the javascript from the input so i’m writing a bit of jquery
the javascript:
<input type="text" id = "IDthisinput'" class="CLthisinput'" placeholder="First"
onChange = "dosomething();"
onKeyPress = "this.onchange();"
onpaste = "this.onchange();"
oninput = "this.onchange();"
/>
<span id="ReturnedMsg"></span>
<span id="IDActionVal"></span>
the jquery:
$('.CLthisinput').on('keyup', function () {
$('#ReturnedMsg').html(dotuff('#'+this.id,$(this).val()));
$('#IDActionVal').html('#'+this.id + ' ' + 'keyup ' + $(this).val());
});
$('.CLthisinput').on('paste', function () {
$('#ReturnedMsg').html(dotuff('#'+this.id,$(this).val()));
$('#IDActionVal').html('#'+this.id + ' ' + 'keyup ' + $(this).val());
});
I’m stumped when it comes to shortening the above, which works fine, to something like this:
$('.CLthisinput').on('keyup', 'paste', function () {
var theaction = event
$('#ReturnedMsg').html(dotuff('#'+this.id,$(this).val()));
$('#IDActionVal').html('#'+this.id + ' ' + theaction + ' ' + $(this).val());
});
How can I get the events to work together?!