$('input[type=password]').each(function(){ var value = $(this).attr('value'); var id = $(this).attr('id'); $(this).hide(); var newField = $(this).clone(); $(newField).attr('type', 'text'); $(newField).attr('id', id + '__display'); $(newField).insertAfter($(this)); $(newField).show(); });