Err, innerHTML is a property of the HTMLElement object or something like that. What you want is a method that sets the innerHTML and returns the object?
I'm pretty sure you can extend the HTMLElement (or whatever it is) class and define your own method to do just that, but I don't know/recall how.
Edit: Quick Google search tells me you want something like
Then you'd just go
Edit:
Edit again:
But apparently this doesn't work in IE, and you have to do this?
I'm pretty sure you can extend the HTMLElement (or whatever it is) class and define your own method to do just that, but I don't know/recall how.
Edit: Quick Google search tells me you want something like
Code:
HTMLElement.prototype.setInnerHTML = function(stuff) {
var element = this;
element.innerHTML = stuff;
return element;
}Then you'd just go
Code:
getElementById('test').setInnerHTML('sample').doFunctionHere();Edit:
Yah, it works.
Edit again:
But apparently this doesn't work in IE, and you have to do this?


![[Image: 30u8phi.png]](http://i41.tinypic.com/30u8phi.png)