Skip to content

Is there any way to detect click event #49

Answered by sa-si-dev
ajit-soman asked this question in Q&A
Discussion options

You must be logged in to vote

@ajit-soman code you have mentioned would work if this code is present after virtual select initialized.

VirtualSelect.init({
  ele: '#sample-select',
  ...
});

$('#sample-select').click(function () {
  console.log(this.value);
});

Alternatively, you could use the below code to add a listener before initialization.

$(document).on('click', '#sample-select', function () {
  console.log(this.value);
});

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
6 replies
@ajit-soman
Comment options

@sa-si-dev
Comment options

@ajit-soman
Comment options

@ajit-soman
Comment options

@ajit-soman
Comment options

Answer selected by sa-si-dev
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants