0
我有這個jquery檢查h2是否包含Simple這個詞,但我不知道爲什麼它不適合我? 這是我的腳本,這裏是我試圖檢查。jquery檢查h2是否包含特定文本
<section class="main">
<nav>
<a class="show-menu"><i class="fa fa-bars fa-lg"></i></a>
<ul>
<li class="static active"><a href="theme"><?php print _("Themes"); ?></a></li>
</ul>
</nav>
<div id="themesList" class="image-list" data-bind="foreach: themes">
<div class="image-item" data-bind="css:{active: ($parent.theme()==id())}">
<h2 data-bind="text: name"></h2>
<img data-bind="attr:{'src': 'themes/'+id()+'/logo.png'}">
<div class="preview-button">
<a data-bind="attr: { href: 'themes/'+id()+'/logo.png'}" data-lightbox="+id()+" data-title=data-bind="attr: { text: 'name'}">Preview</a>
</div>
<div class="secondary inactive-button" data-bind="click: $parent.showApplyDialog"><?php print _("Apply Theme"); ?></div>
<div class="active-button" data-bind="click: $parent.showResetDialog"><?php print _("Reset Theme"); ?></div>
</div>
<script type="text/javascript">
var $h2 = $('.image-item h2');
if ($h2.text().indexOf('simple') > -1) {
$h2.hide();
}
</script>
</div>
<!-- /.list -->
</section>
<!-- /.main -->
數據綁定是什麼填充H2
所以如何將添加數據綁定?我試過你的,它仍然沒有隱藏,我非常感謝你的幫助 – user3546263
@ user3546263你使用基諾(JavaScript)? –
是的......我只是想要它隱藏它,如果h2說簡單...... lol – user3546263