Sorry if this is a stupid question,
I have a javascript function like:
Test.prototype.createElement = function()
{
this.oCanvas = document.body;
var oDiv = document.createElement('div');
oDiv.style.position = "absolute";
this.oCanvas.appendChild(oDiv);
return oDiv;
}
While converting this function to jQuery, I did this:
Test.prototype.createElement = function()
{
this.oCanvas = document.body;
var oDiv = $('<div />').attr("postion", "absolute");
$(this.oCanvas).append(oDiv);
return oDiv; /* ****** This is not correct I think ******* */
}
or is there a better way?