i need to do array and then send in php file with help ajax. I have code:
$(function() {
$('.photo-user-change').bind('click', function(){
var hasclass = $(this).hasClass('active');
if(hasclass == true) {
$(this).removeClass('active');
} else {
$(this).addClass('active');
var iwa = $('.active').attr('id');
alert(iwa);
}
});
});
and html:
<ul>
<li class="photo-user-change" id="1">1</li>
<li class="photo-user-change" id="2">2</li>
<li class="photo-user-change" id="3">3</li>
</ul>
When added class 'active' need introduce ID into an array and then sent this array in php file. ID maybe a few.
How do this? I need create multi selector. thanks.
clickevent on all elements of classphoto-user-change, but what are those elements? Links, photos, divs? When [users] click, what do they expect to do? What does the array need to store, multiple IDs?