# Need help with innerHTML - Don't know how to explain this in the subject

**URL:** https://forum.kirupa.com/t/need-help-with-innerhtml-dont-know-how-to-explain-this-in-the-subject/328896
**Category:** web dev
**Created:** [June 29, 2012, 4:23am UTC](https://forum.kirupa.com/t/need-help-with-innerhtml-dont-know-how-to-explain-this-in-the-subject/328896 "2012-06-29T04:23:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jany](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@jany](https://forum.kirupa.com/u/jany)
#### Post date: [June 29, 2012, 4:23am UTC](https://forum.kirupa.com/t/need-help-with-innerhtml-dont-know-how-to-explain-this-in-the-subject/328896/1 "2012-06-29T04:23:00Z")

</div>

Say I have an html id called “test” with the text “hello this is a test”.

I then want to manipulate that text, so I use this:  
document.getElementById(“test”).innerHTML= “hello this is a very great fun test”;

So that works, and it changes fine. But what I am trying to do is add tags within the text. But if I do that, HTML reads the tags and displays whatever the tags are saying to do. What I mean is, what if I wanted to show this as TEXT rather than allow HTML to suck it in and display the image:  
“\<img src=“[http://www.doesntmatter/images/fun.JPG](http://www.doesntmatter/images/fun.JPG)” BORDER=“0”\>”

So to gain a clearer understanding of what I am trying to do, imagine a user clicks an image called fun.jpg on your site. Under the image, prior to clicking it, the image reads “hello this is a test”. Now, if the user clicks the fun.jpg image, you want to change that text to “\<img src=“[http://www.doesntmatter/images/fun.JPG](http://www.doesntmatter/images/fun.JPG)” BORDER=“0”\>”

This way the user sees this exact tag displayed below the image. Is there a way to do this via innerHTML or do I have to write it out another way?

Thank you!!
