jQuery Ajax added select drop down won't alert when I change the item in the drop down.
- // when you click submit num tabs
// you get form fields for tabs
$('#num_tabs_submit').click(function(){
var num_tabs = parseInt($('#num_tabs').val());
for(var i = 0; i < num_tabs; i++) {
$.ajax ({
type: 'post',
url : 'http://dev.touchstorm.com/ten_hpn_admin/index.php/manage_user/get_channels',
success: function(results) {
$('#tab_content').append('<label>Tab Name<span>*</span><br />' +
'<input type="text" class="text tab_text" name="tab' + i + '" /> <br/>Choose Channel: ' +
'<select id="main_categories' + i + '" class="categories">' +
results +
'</select>' +
'</label><br/><div id="video_results"></div>');
} // end success
}); // end ajax
}
return false;
}); // end tabs create
$('.categories').change(function(){
alert("hello");
});
The problem is that the $('.categories').change() stuff doesn't alert the hello like it's supposed to. I am not sure why it won't work properly. If there is anyway you all could help I would really appreciate it a bunch.