2

Knockout Template

<select data-bind="event:{ change: permissionChanged}">
    <option data-bind="i18n: 'Yes', value: 'yes'"></option>
    <option data-bind="i18n: 'No', value: 'no'"></option>
</select>

Js Function

permissionChanged: function(obj, event){
    console.log('value Changed');
},

So basically I want to access the value when the end-user changes the value on the select element.

Currently when the user changes the value in the dropdown then the function is called but I want value there.

Your help will be appreciated. Thanks in advance.

enter image description here

1
  • Added answer let me know if it's helpful or not. Jan 21, 2022 at 11:42

1 Answer 1

3

Try with this below code :

console.log(event.target.value);
2
  • Thanks :) @Rohan Jan 21, 2022 at 11:42
  • Mark as upvote and accept answer if it's useful. Jan 21, 2022 at 11:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.