Pass a client side Javascript to an HTML Element Dynamically

That didn’'t work either. It seems like when I try any method on document other than document.write, I get no results. I have even tried deleteing and recreating an HTML element - so that I delete a paragraph and recreate the same paragraph every time through the loop.