Cross Browser HTML 5

Pada Postingan Kali Ini saya akan Membeberkan sedikit tentang Cross Browser HTML 5 Sobat Bisa Langsung Praktek di bawah


JQUERY :$('[placeholder]').each(function() { var plc = $(this).attr('placeholder'); $(this).addClass('blur').removeAttr('placeholder').val(plc).on("focus blur", function(e){ //Add a 'blur' class to fade the text color for the default placeholder text $(this)[e.type == "blur" &&](this.value === "" || this.value == plc)) ? "addClass" : "removeClass"]('blur'); // Set The Value To 'Plc' on blur if the element value is empty if (e.type == "blur" && this.value === "") $(this).val(plc); // Set the value to empty on focus if the element value is same with the default placeholder text if (e.type == "focus" && this.value == plc) $(this).val(""); });});
CSS :
input.blurtextarea.blur {color:#bbb} 

0 Response to Cross Browser HTML 5

Post a Comment