Reputation: 189
How do I trigger a click event of a div on page load using knockoutJS? I tried
$(document).ready(function () {
$('.divClass').first().trigger('click');
}
Upvotes: 2
Views: 1864
Reputation: 17564
The whole point of MVVM is to seperate the View and the view logic (ViewModel). Instead of trigger the click trigger the function on the view model that is bound to the click
Upvotes: 1