Avoid repetition by passing in a value
<p>I'm inserting images into dom with javascript and I would like to pass in the second classname and some other properties of the images while calling the function.</p>

<p>So I have functions containing code this:</p>

<pre><code>function movieCreator(movieName){

'&lt;img class="clip terminator" src="images/terminator.png" onclick="imageControl(this);" alt="terminator" /&gt;','

};

 function movieCreator(movieName){

'&lt;img class="clip rambo" src="images/rambo.png" onclick="imageControl(this);" alt="rambo" /&gt;'

 };
</code></pre>

<p>There is some other stuff inside those functions too but I'm trying to simplify the question a bit. I would like to pass in the words "terminator" and "rambo" while calling the functions like</p>

<pre><code>movieCreator(terminator);
movieCreator(rambo);
</code></pre>

<p>but my head gets really stuck while I  try to think where to place the quotes and things like that in order to replace those words correctly from the code.</p>

<p>So my question is this: what would be the correct syntax of replacing the word "terminator"  with a dynamical value that is passed in when the function is called?</p>
