Zion
Zion

Reputation: 753

JavaScript Variable in html

I want to add a element to a Table via java script where the cells are varibales. For this i wrote below code:

$("#AppendAnlagen").parent().append("<tr><td><asp:Label runat='server' text="+args[0]+"/></td></tr>");

on the Page i see +args[0]+ and not the value.

Upvotes: 0

Views: 39

Answers (1)

Sapikelio
Sapikelio

Reputation: 2604

On text attribute you have forgotten simple quotes. Replace text="+args[0]+" by text='"+args[0]+"'

Upvotes: 2

Related Questions