Bind a click value to a dynamically generated list.
Hi, I am using a dynamic list with the code below to populate the <daytime> list. What I would like to know is how I can bind a click value to the dynamicaly generated list items?
Thanks in advance,
Lammie.
- $('#listDetail').attr("data-theme", "a").removeClass("ui-btn-up-b").addClass("ui-btn-up-a");
- var size = this.text;
- var jdetail = $("#daytime");
- jdetail.html("<li data-role='list-divider' data-theme='c'>Available Riders</li> ");
-
- for($n=1;$n<(team[lt].length);$n++){
- var item = this;
- var jrecord = $("<li><a href='#shirt' data-transition='slide'></a></li>");
- jrecord.find("a:first").text($n);
- jdetail.append(jrecord);
- };
- jdetail.listview("refresh","true");
- });
- // This is the listing in the code:
- <ul data-role="listview" data-inset="true" data-theme="d" data-divider-theme="e" id="daytime" style="border:2px solid #FFF; border-radius:10px;">
- <li><a href="#">Page</a></li>
- </ul>