Modify userInput on submit
<p>I need help with this javascript, if a user inputs anything in the filed the field will print that value, but i want to modify specific part of the value. users are going to submit image urls which have a specific string that i need to modify.</p>

<p>For instance user input something like: <strong>http://www.domain.com/photos/1.jpg</strong></p>

<p>The result should be: <strong>http://www.domain.com/photos-d/1.jpg</strong></p>

<p><strong>Here is the code:</strong></p>

<pre><code>&lt;script type="text/javascript"&gt;
function changeText2(){
    var userInput = document.getElementById('userInput').value;
    document.getElementById('result').innerHTML = userInput;
}
&lt;/script&gt;

&lt;input type='text' id='userInput' onblur="if(this.value.length == 0) this.value='Enter Image URL';" onclick="if(this.value == 'Enter Image URL') this.value='';"/&gt;
&lt;input type='button' onclick='changeText2()' value='Generate'/&gt;

&lt;p&gt;Output: &lt;a id='result'&gt;&lt;/a&gt; &lt;/p&gt;
</code></pre>

<p>your help will be much appreciated - Thanks, </p>
