jq选中问题

var objs = $("div[id^='offer_details_']");

//遍历点击事件监听问题

onclick="details("+offer.id+")“

function details(offerId){

}

//tabs页签切换事件
$(document).ready(function () {
  $("#tabs li").bind("click", function () {
    var index = $(this).index();//输出选中的下标
    alert(index);
    //var divs = $("#tabs-body > div");//选中下一级div
    //divs.hide();//隐藏所有选中项内容
    //divs.eq(index).show(); //显示选中项对应内容
    $(this).parent().children("li").attr("class", "");//将所有选项置为未选中
    $(this).attr("class", "am-active"); //设置当前选中项为选中样式

  });

});

原文地址:https://www.cnblogs.com/sho560/p/5579833.html