Possible Duplicate:
Invalid assignment left-hand side, javascript
var htmlToAdd = '<label for="A'+indexNr+'" class="PriceLabel">Min</label>'
+= '<input style="width:3em" name="B'+indexNr+'" id="B'+indexNr+'" type="text" />'
+= '<label for="C'+indexNr+'" class="MaxPriceLabel">Max</label>'
+= <input style="width:3em" name="D'+indexNr+'" id="D'+indexNr+'" type="text" />';
I am trying to create html as string and then use append to some another html element. Firebug is giving me
invalid assignment left-hand side
[Break On This Error] += '<input style=...rcentage'+indexNr+'" type="text" />'
Replace
+=with++=means “Take the variable on the left, append what is on the right to it, then assign back to the variable” … but you have a string to the left of each one, not a variable.