<ul class="filter-list">
<li class="filter">
<select class="field" name="field">
<select class="exclude" name="exclude">
<input class="value" type="text" autocomplete="off" value="*:*" name="value">
<a class="action remove-filter disabled" title="remove">
<span>remove</span>
</a>
<a class="action add-filter" title="add another">add another</a>
</li>
</ul>我想在页面加载时删除tag的"add another“值。我们怎么才能做到这一点..有什么建议吗?
发布于 2011-06-17 03:23:57
使用jquery可以做到这一点
<script type="text/javascript">
$(doucument).ready(function(){
$('.add-filter').html("");
});
</script>发布于 2011-06-17 03:22:22
如果我理解正确的话:
$('.add-filter').remove(); //removes the <a> tag
$('.add-filter').empty(); //removes the html inside the <a> tag发布于 2011-06-17 03:22:36
要删除a元素中的文本,请执行以下操作:
$('a.action.add-filter').text('');
要删除整个元素,请执行以下操作:
$('a.action.add-filter').remove();您需要将其封装在准备好的DOM中,如下所示:
$(function(){
$('a.action.add-filter').text('');
});https://stackoverflow.com/questions/6377352
复制相似问题