I am creating an element with document.createElement().
Now how can I pass it to a function that only takes a Jquery object?
$("#id")
I can not use it, as the element has not been rendered in the page yet.
Answer
var elm = document.createElement("div");
var jelm = $(elm);//convert to jQuery Element
var htmlElm = jelm[0];//convert to HTML Element
No comments:
Post a Comment