I have an editor for non technical people to build their specific application. A few places though I need to insert an 'em' after the value they enter so it passes it correctly to my back-end.
For this I have something like this
$( "input[name*='width']" ).on( "focusout", function(){
var value = $(this).val();
if(value.indexOf("em") <= 0 && value.indexOf("px") <= 0 && $(this).val().length != 0){
var newVal = value+'em';
$(this).val(newVal).trigger('change');
}
});
My question is. Is there a way to make that selector non-case sensitive so I don't have to repeat the code twice one with a lower case and one with an uppercase to catch all the cases?
To the possible duplicate. I cannot use that answer. I have already looked at that and can't use the filter in this case.