Returning an element's inner HTML in a function?


#1

Just wondering, is there a way to return an element’s inner HTML in a javascript function? Similar to the “getElementProperty()” api, but it returns the innerHTML?

This would be useful for my current project, but not necessary.


(Jonathan Deutsch) #2

all you need is element.innerHTML :slight_smile:.

The “elements” in Hype are standard DOM elements. The reason for the getter/setter API is to keep the runtime knowledgeable about the changes made or to deal with some cases where Hype has to do a bit more work because of how it built the DOM. InnerHTML is simpler and so you don’t need the API for it.


#3

Oh wow, that’s awesome! Thank you so much!