Appended content using jQuery 'append' is not submitted?
- by YourMomzThaBomb
I'm new to jQuery so this may be a real simple answer. I have a ASP.NET project that I'm trying to dynamically add content to a span element by typing into a text box and clicking a button. Sounds simple right? Well, I can get the content to added, but when the form is submitted the span element is still empty? Why is the new data not submitted? What step am I missing? Please help. Here's some sample code:
< span id="tagContainer" runat="server"< /span
< input type="text" name="tag" id="tag" /
< input type="button" name="AddTag" value="Add" class="button" onclick="addTag();" /
function addTag() {
if ($("#tag").val() != "") {
$("#tagContainer").append('$("#tag").val()');
$("#tag").val("");
}
}