Skip to content

Instantly share code, notes, and snippets.

View Gaya's full-sized avatar
🌱
Coding on plants

Gaya Kessler Gaya

🌱
Coding on plants
View GitHub Profile
@Gaya
Gaya / jquery.placeholdereasy.js
Created March 19, 2012 15:00
Placeholder script jQuery
/*
* Short jQuery method of making placeholders for all the browsers.
*
* Use the following HTML markup to make this work:
* <input type="text" class="placeholder" value="Your name" data-standard="Your name" />
*/
$(".placeholder").focus(function () {
if ($(this).val() == $(this).attr("data-standard")) {
$(this).val("").addClass("active"); //Add class for other styling