<div class="address_list_row"> <div class="address_check_box" tit="address_checkbox"></div> <div class="addredd_edit"><img src="img/icon_edit.svg"></div> <span class="f14 b">大柴</span><br/> <div class="address_tel">13685871247</div> 浙江省寧波市鄞州區梅墟街道研發園C9-12A </div>jquery
<div class="address_list_row"> <div class="address_check_box" tit="address_checkbox"></div> <div class="addredd_edit"><img src="img/icon_edit.svg"></div> <span class="f14 b">大柴</span><br/> <div class="address_tel">13685871247</div> 浙江省寧波市鄞州區梅墟街道研發園C9-12A </div>svg
--------------------------------jquery代碼以下-------------------------------------- var get_checkbox=$(".address_list_row > div[tit='address_checkbox']")this
get_checkbox.click(function(){ $(this).addClass("address_check_boxed"); $(this).parent().siblings().children("div[tit='address_checkbox']").removeClass("address_check_boxed"); })
================================================== 爲何把這個帖子貼出來?主要是由於這個查找的方式比較特殊,點擊當前,獲取到當前的同類父類的子項,而後進行操做。spa