Я не могу изменить свойства css div при вызове функции onClick.Как вызвать функцию 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 начинается как видимость: скрыто.
Что происходит между символом '' '' '' '? –