Bootstrap

andSelf()使用

//判断xxx的父元素或自己是否为img类的元素

$("#XXX").parents().andSelf().is('.img');