erang placeholder js
This commit is contained in:
parent
1353fc4fbb
commit
eab5b07dc4
|
@ -7,8 +7,8 @@ $(document).ready(function() {
|
||||||
$('input, textarea').each(function() {
|
$('input, textarea').each(function() {
|
||||||
var hasPlaceholder = $(this).attr("data-placeholder") == undefined ? false : true;
|
var hasPlaceholder = $(this).attr("data-placeholder") == undefined ? false : true;
|
||||||
if (hasPlaceholder) {
|
if (hasPlaceholder) {
|
||||||
var placeholderText = $(this).data("placeholder") = $(this).attr("data-placeholder");
|
$(this).data("placeholder") = $(this).attr("data-placeholder");
|
||||||
$(this).addClass("placeholder").val(placeholderText);
|
$(this).addClass("placeholder").val($(this).data("placeholder"));
|
||||||
$(this).focus(function() {
|
$(this).focus(function() {
|
||||||
var currText = $(this).val();
|
var currText = $(this).val();
|
||||||
if (currText == $(this).data("placeholder")) {
|
if (currText == $(this).data("placeholder")) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user