Within the input-control
, there is a label
:
<div class="input-control modern text" data-role="input">
<input name="salle_lib" id="salle_lib" type="text" maxlength="70" placeholder="libellé" data-validate-func="required" data-validate-hint="Ce champ est obligatoire"/>
<button class="button helper-button clear"><span class="mif-cross"></span></button>
<span class="label">libellé</span> // this is the label
</div>
The typical behavior in MetroCSS is that the label only appears when the input-control
is clicked:
.input-control.text > .label {
position: absolute;
left: 0;
top: -1rem;
font-size: .875rem;
}
.input-control.modern input:focus ~ .label {
opacity: 1;
-webkit-transform: translateY(-18px);
transform: translateY(-18px);
transition: all 0.3s linear;
}
I would like the label to be visible at all times, not just when the input-control is clicked. I attempted to use
$(".input-control.text").click();
, but it did not work! Any suggestions on how to achieve this?
Check out the code snippet on jsfiddle.