Javascript invalid assign left hand side -
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 trying create html string , use append html element. firebug giving me
invalid assignment left-hand side
[break on error] += '<input style=...rcentage'+indexnr+'" type="text" />'
replace +=
+
+=
means "take variable on left, append on right it, assign variable" … have string left of each one, not variable.
Comments
Post a Comment