javascript - Click function not working on dynamically added div -
this question has answer here: event binding on dynamically created elements? 19 answers <button id="add_tab">add tab</button> <input id="text-search" type="text"/> <div id="tabs"> <ul> <li><a href="#tabs-1" style="padding:0;"><span class="color-bar"> </span><div class="alert-header">alert #1</br><span class="time-date">5:30pm - 07/11/2014</span></div><span class="ui-icon ui-icon-close" role="presentation">remove tab</span></a></li> <li><a href="#tabs-2" style="padding:0;"><span class="color-bar"> </span><div class="alert-header">alert #2</br><...