mój kod jest taki
jQuery('#haslo').focus(function() {jQuery('#haslo').val(''); jQuery('#haslo').attr("type", "password");});
niestety, pole czyści się ale nie zmienia na password, jak coś wpisuję ot nie jest zakrywane gwiazdkami... Co robię źle??
jQuery('#haslo').focus(function() {jQuery('#haslo').val(''); jQuery('#haslo').attr("type", "password");});
jQuery('#haslo').focus(function() { jQuery('#haslo').replaceWith('<input type="password" name="" class="reg_input" id="haslo" />'); jQuery('#haslo').focus(); });
jQuery('#haslo').blur(function() { jQuery('#haslo').replaceWith('<input type="text" name="" class="reg_input" id="haslo" value="Hasło" />'); jQuery('#haslo').focus(); });
$(document).ready(function() { setFocus(); // Ustawiam focus na pole typu text }); function setFocus() { jQuery('#haslo').focus(function() { jQuery('#haslo').replaceWith('<input type="password" name="" class="reg_input" id="haslo" />'); jQuery('#haslo').focus(); jQuery('#haslo').blur(function(){ if($(this).val() == '') { // Nie uzupełniono pola jQuery('#haslo').replaceWith('<input type="text" name="" class="reg_input" id="haslo" value="Hasło" />'); setFocus(); // Ustawiam ponownie focus na pole typu text } }); }); }