第2个回答 2012-07-27
<input type="text" value="please input password" onfocus="psw(this)" onblur="txt(this)"/>
function psw(el) {
if (el.value == 'please input password') {
el.value = '';
el.type = 'password';
}
}
function txt(el) {
if (!el.value) {
el.type = 'text';
el.value = 'please input password';
}
}本回答被网友采纳