Just a quick little thing I’m obviously doing wrong:
theDiv.append('<input type="button" id='+id+ 'value='+value+'></input>');
Where id and value are variables that I assign to as strings. Why wouldn’t this work? What’s the quick work-around?
thanks.
You need a space between the id and the
valueattribute:I also added double quotes around the attribute values, and removed the closing
</input>tag.This results in:
…given “id” as the value of
id, and “value” as the value ofvalue.The way you had it, the value of the
idattribute, and thevalueattribute itself were merged, so if the value ofidwas “id”, it would look like: