After reading about valHooks
in a jQuery defect and more recently seen in a fiddle I searched the jQuery documentation and Google but I can\'t find anything other t
I did a little writeup with a simple example here.
$.valHooks['myedit'] = {
get : function(el) {
return $(el).html();
},
set : function(el, val)
{
$(el).html(val);
}
};
$.fn.myedit = function()
{
this.each(function() {
this.type = 'myedit';
});
return this;
}
$('#edit').myedit().val(' Hi there!');
$('#value').html('The value is : ' + $('#edit').val());