我无法在调用onClick函数时更改div的css属性。如何使用引导按钮和窗体内部调用onClick javascript函数?
<h1 id="hello">hello</h1>
<div id="notification" class="alert alert-dismissible alert-success">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>Well done!</strong> You successfully posted to Facebook!
</div>
<div align="center" class="col-sm-4">
@using (Html.BeginForm("distShare", null, new { area = "" }))
{
<button onclick="facebookButton2()" class="btn btn-primary" type="submit">Share this to Facebook</button>
}
</div>
function facebookButton2() {
document.getElementById("notification").style.visibility = visible;
document.getElementById("notification").style.color = red;
document.getElementById("hello").style.color = red;
}
的 “你好” 只是用于测试目的。我也尝试过使用JQuery和onSubmit函数。通知div以可见性开始:隐藏。
'''@'''符号之间发生了什么? –