$('input').each(function(){ var a = $(this).val($(this).val().replace("gmail","hotmail")); console.log(a); });