Hello All,
I am working on this login page. And i have this script. The first part works very well. When I click the username textbox it cleanses it, if it looses focus and its blank the text "Username:" appears again if not it stays with the username.
The second textbox Password does it if i dont include the propierty "type" bue if i also want to changee this propierty it does it until the second attempt. For both twxtboxes i run this script on click and onblur. for the problematic textbox if i click id does not cleans the text until I exit the textbox it clears it. Any ideas?

function textboxfunctions(el) {
var elemento = document.getElementById($(el).attr("id"));

switch (elemento.id) {
case 'txtUsername':
if (elemento.value == 'Username:') {

elemento.value = '';
}
else {
if (elemento.value == '') {
elemento.value = 'Username:';
}
}
break;
case 'txtPassword':
if (elemento.value === 'Password:')
elemento.type = 'password',
elemento.value = '';

else
if (elemento.value === '')

elemento.value = 'Password:',
elemento.type = 'text';


break;
default:

}



}


</script>