html:
<div >
<a class="pro deleteBrand" title="适⽤季节" href="javascript:void(0);">适⽤季节
<span class="icon-btn-x">x</span>
</a>
<a class="pro deleteBrand" title="适⽤季节" href="javascript:void(0);">适⽤季节
<span class="icon-btn-x">x</span>
</a>
<a class="pro deleteBrand" title="适⽤季节" href="javascript:void(0);">适⽤季节
<span class="icon-btn-x">x</span>
</a>
<a class="pro" id="btn-brand-search" title="适⽤季节" href="javascript:void(0);">更多∨</a>
</div>
js:
记住我deleteBrand : function () {
$(".deleteBrand").click(function (aa) {
$(this).css('display', 'none');
//$(this).parent().css('display', 'none');
});
}
2.在html页⾯写click事件
html:
<div >
<a class="pro" data-url="nav" title="适⽤季节" href="javascript:void(0);" onclick="new goodsUpperAndLower.init().deleteBrand(this);">适⽤季节
<span class="icon-btn-x">x</span>
</a>
<a class="pro" data-url="nav" title="适⽤季节" href="javascript:void(0);" onclick="new goodsUpperAndLower.init().deleteBrand(this);">适⽤季节
<span class="icon-btn-x">x</span>
</a>
<a class="pro" data-url="nav" title="适⽤季节" href="javascript:void(0);" onclick="new goodsUpperAn
dLower.init().deleteBrand(this);">适⽤季节
<span class="icon-btn-x">x</span>
</a>
<a class="pro" id="btn-brand-search" title="适⽤季节" href="javascript:void(0);">更多∨</a>
</div>
js:
deleteBrand : function (obj) {
//$(obj).parent().css('display', 'none');
$(obj).css('display', 'none');
}
发布评论