i need some help with my form.
I want the same form like this site :
They say, if a placeholder is set, the label should move. Can someone help me with this, i dont know how i can do it.
Here is my Demo: http://codepen.io/CRYP3/pen/WRvyxw
try this code, I didn't check it, so no idea if this will work:
$(function() {
$("#username").focusin(function() {
if($("#username").val().length < 1)
$("#label").addClass("active");
});
$("#username").focusout(function() {
if($("#username").val().length < 1)
$("#label").removeClass("active");
});
});
1st you need to set id
for your label, then you need a class active
, that will actually move the label.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.