JSFiddle - React, Tailwind, and code Playground
by Steffi
HTML
<div id="login-form-mani">
<form>
<p>Connectez-vous</p>
<input type="text" id="email-mani" class="input" value="E-mail" data-placeholder="E-mail" />
<input type="text" id="password-mani" class="input" value="Mot de passe" data-placeholder="Mot de passe" />
<input type="submit" class="submit" value="Connexion" />
</form>
</div>
CSS
/*
Author: Steffi Rakotozafy
Author URI: http://www.steffirakotozafy.com
*/
/* Fonctions */
/* =Reset
-------------------------------------------------------------- */
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
vertical-align: baseline;
}
body {
line-height: 1;
}
ol,
ul {
list-style: none;
}
blockquote,
q {
quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
caption,
th,
td {
font-weight: normal;
text-align: left;
}
h1,
h2,
h3,
h4,
h5,
h6 {
clear: both;
}
html {
overflow-y: scroll;
font-size: 100%;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
a:focus {
outline: thin dotted;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section {
display: block;
}
audio,
canvas,
video {
display: inline-block;
}
audio:not([controls]) {
display: none;
}
del {
color: #333;
}
ins {
background: #fff9c0;
text-decoration: none;
}
hr {
background-color: #ccc;
border: 0;
height: 1px;
margin: 24px;
margin-bottom: 1.714285714rem;
}
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
small {
font-size: smaller;
}
img {
border: 0;
-ms-interpolation-mode: bicubic;
}
body {
font-size: 12px;
color: #444;
font-family: Arial, Helvetica, sans-serif;
}
#login-form-mani {
padding-left:...
JavaScript
$("#password-mani").focus(function(){
if($(this).val() == $(this).data("placeholder")) {
$(this).val("");
$(this)[0].type = 'password';
}
});
$("#password-mani").blur(function(){
if($(this).val() == '') {
$(this).val($(this).data("placeholder"));
$(this)[0].type = 'text';
}
});
$("#email-mani").focus(function(){
if($(this).val() == $(this).data("placeholder"))
$(this).val('');
$(this)[0].type = $(this).data("placeholder");
});
$("#email-mani").blur(function(){
if($(this).val() == '')
$(this).val($(this).data("placeholder"));
$(this)[0].type = 'text';
});