partials in innerHTML ?

I have a set of javascript functions that are reading json data periodically to create innerHTML in a view.

Within that innerHTML, I need to put form(s) based on the structure and content of a row in a table. I am thinking I will just have to somehow hard-code this in html. Perhaps there is a better way?

I'm hoping someone here has a suggestion....I'm thinking maybe partials (?) but the entire innerhtml is exactly that, just pure html. Surely there has to be a way to accomodate this. Thanks Rvince