I got the following code to change text in a input if it has presence of a text set in the attribute texttoreplace of this same input:
$(".replace_path").focusout(function() {
$(".replace_path").val($(".replace_path").val().replace($(this).attr('texttoreplace'),""));
});
Its working fine except I can only trigger when the focus is out. Is there a way to accomplish the same result triggering the event in case value > 0? Cause I got another java script source adding the text to that input. (its not being typed).
Thanks,