Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

3 Commits

Repository files navigation

Brings HTML5 "placeholder" attribute into all older browser

example:

<!DOCTYPE html><html><head><scripttype="text/javascript" src="placeholder.min.js"></script><scripttype="text/javascript">functioninsertInput(){varinput=document.createElement('input');input.type="text";input.setAttribute('placeholder',"Enter value");document.body.appendChild(input);inputPlaceholder(input);}</script><styletype="text/css">input {
color:#f00;
text-align: center;
}
/* * Стиль для браузеров не поддерживающих * placeholder или псевдо-елемента input-placeholder */input.input-placeholder {
color:#00f;
text-align: center;
}
/* * Стиль для WebKit браузера ( Chrome ) */input::-webkit-input-placeholder {
color:#00f;
text-align: center;
}
/* * Стиль для Mozilla ( FireFox ) */input:-moz-placeholder {
color:#00f;
text-align: center;
}
</style></head><body><inputtype="text" value="" placeholder="Enter name" /><inputtype="text" value="" placeholder="Enter email" class="vasya" /><inputtype="password" value="" placeholder="Enter password" class="petya" /><buttononclick="insertInput();">Insert new input</button></body></html>

About

Brings HTML5 "placeholder" attribute into all older browser

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages