This is a continuation of Jeditable: how to set parameters based on attributes of the dom element
Please answer here .. this is my real account.
I am trying to assign different parameter values โโto different divs on which I included the jQuery 'Jeditable' plugin. I canโt make it work, Iโm sure it is something simple .. but I canโt figure it out.
How to get it?
Given the following DOM element:
<div class="editme" id="theone" rel="test"></div>
These various snippets produce the following dafault placeholder texts for the above empty div:
$('.editme').editable('savedata.php',{ placeholder : "txt - "+$(this), } ); // outputs: "txt - [object Object]" $('.editme').editable('savedata.php',{ placeholder : "txt - "+this, } ); // outputs: "txt - [object HTMLDocument]" $('.editme').editable('savedata.php',{ placeholder : "txt - "+$(this).html(), } ); // outputs: "txt - undefined" $('.editme').editable('savedata.php',{ placeholder : "txt - "+$(this).attr('rel'), } ); // outputs: "txt - undefined" $('.editme').editable('savedata.php',{ placeholder : "txt - "+this.attr('rel'), } ); // outputs: "" (NULL / EMPTY STRING, must be due to error)
source share