Suppose I’m using a “placeholder” jQuery plugin that reads the “placeholder” attribute from input elements and simulates it for browsers that don’t yet support placeholders.
But I would still like $(“input”).val() to work properly — that is, to return “” if the text in the textbox is the placeholder text. Is there anyway I can override .val() just for these inputs?
try this:
and simply use $(“#ele_id”).rVal() to retrieve values.
Or if you want to replace the val function (and use it as normal):