如何从html中看到javaScript按钮 [英] How to make javaScript button visible from html
本文介绍了如何从html中看到javaScript按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我的javaScript文件中有以下按钮
Hi
I have this button below in my javaScript file
html('<a href="#" ' + (aData["isActive"] ? 'class="btn-action glyphicons ok_2 btn-success"' : 'class="btn-action glyphicons remove_2 btn-danger"') +
'" id="' + nRow + '" önclick="this.src = onSaveCampusStatus(' + "'isActive'" + ',this.src,' + aData["campusID"] + ')" ></a>');
当你点击这个按钮它应该改变它css。
问题是,如何使这个按钮可见我的HTML?
when u click this button it should change it css.
Problem is, How do I make this button visible in my html?
推荐答案
注意:btn-danger。它正在使用Bootstrap。你知道你必须在你的文件中包含bootstrap引用吗?
棘手的东西?三元运算符。如果adata [isActive]的值为true,那么它将按钮设置为btn-action类,否则它是btn-danger。
我同意,设置可见性:
Note: btn-danger. It's using Bootstrap. Do you know you have to include bootstrap reference in your file?
Tricky stuff with ? ternary operator. If the value of adata["isActive"] is true then it sets up the button to be btn-action class otherwise it's btn-danger.
I agree, set the visibility:visible style on the
上的可见样式
这篇关于如何从html中看到javaScript按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文