1
Option onFocus
and onBlur
:
function change() {
document.getElementById('login').placeholder = 'Alterado';
}
function changeBack() {
document.getElementById('login').placeholder = 'Login';
}
input {
padding: 12px;
}
::-webkit-input-placeholder { /* Chrome/Opera/Safari */
font-size: 16px;
}
::-moz-placeholder { /* Firefox 19+ */
font-size: 16px;
}
:-ms-input-placeholder { /* IE 10+ */
font-size: 16px;
}
:-moz-placeholder { /* Firefox 18- */
font-size: 16px;
}
input:focus::-webkit-input-placeholder { /* Chrome/Opera/Safari */
font-size: 20px;
}
input:focus::-moz-placeholder { /* Firefox 19+ */
font-size: 20px;
}
input:focus:-ms-input-placeholder { /* IE 10+ */
font-size: 20px;
}
input:focus:-moz-placeholder { /* Firefox 18- */
font-size: 20px;
}
<input type="text" onFocus="change()" onBlur="changeBack()" name="login" placeholder="Login" required id="login">
Thank you very much, guys
– Lucas Barbosa Fonseca