Edit attribute value in an HTML string
<p>So, I've got a string. The string contains html. I'm checking the string for 'name', if it doesn't have one I'm using sneaking one in there if it does I need to change what it is.</p>

<pre><code>var myString = '&lt;input id="accountUser_c967817c993e62b1de50e4f0401a03ae" type="hidden" value="c967817c993e62b1de50e4f0401a03ae" name="addRow[]"&gt;&lt;div class="colors goldbluegreenorange"&gt;&lt;/div&gt;';
if (myString.indexOf('name') == -1) {
    myString = myString.substr(0,myString.indexOf('&gt;')) + ' name="addRow[]"' + myString.substr(myString.indexOf('&gt;'));
} else {
    //get what's inside name's quotes and change it to removeRow[]. 
}
</code></pre>

<p>I've got jquery going on too, if that makes more sense than straight javascript.</p>
