Alright, I have this code:
jquery
//add watermark effect to the specified input box
//get the
var wm = $("input.watermark").attr("title");
$("input.watermark").watermark(wm);
//end
the code above, should add a watermark base from the title into those input element that has a class of watermark. Now what i was thinking is to make the code easier and simple and implement an effective way to do that but i just dont know how. In my ideas, jquery’s ‘each’ function should able to do that, but i dont know how to make it so please help and if there is other way to do that please suggest nor recommend. Anyway, Im open in ideas, recommendation and suggestion. Thank you.
You can use the
placeholderattribute instead fairly dependently now. It’s far superior for a lot of reasons. IE 8- will still need JS handling, though.