Published
- 1 min read
jquery trigger
The solution for this is noted below
jquery trigger
Solution
$('#foo').on('click', function () {
alert($(this).text())
})
$('#foo').trigger('click')
$('#foo').on('custom', function (event, param1, param2) {
alert(param1 + '\n' + param2)
})
$('#foo').trigger('custom', ['Custom', 'Event'])
Try other methods by searching on the site. That is if this doesn’t work