I'm creating a html
node by jQuery
(the sample is of tag <input>
but can be of any type):
var x = $("<input>");
Then I add its attributes through a series of .prop()
function:
x.prop("id", ...).prop("class", ...);
Now a certain plugin does not support JQuery object, but rather the HTML
string so I invoke the plugin through this:
var n = plugin.method1(x.html())
Which I though will work but .html()
returns an empty string. Although some said it will be resolved if I append it first on the DOM tree. How can I get its HTML string without appending it first in the DOM tree?