我正在尝试使动态创建的元素在单击时位于其他元素之上,如下所示:
$("#clicks").on('click', '[id^=pin]', function (e) {
for ($i = 0; $i <= $("#clicks").children('.pin').length;$i++){
if ('pin' + $i == this.id) {
$(this).css({ 'z-index': '9999' });
} else {
//How to set reset the z-index of other elements?
}
}
})