<input type="hidden" name="test" value="test"/>

i want using ko get value of input. my component

], function(Component) {
    'use strict';
    return Component.extend({
        initialize: function () {
            // component initialization logic
            return this;
  • You should use data-bind to get value in html
    – aravind
    Jun 25, 2019 at 4:49
  • <input type="hidden" id="test2" data-bind="value: yourValue()"/>
    – aravind
    Jun 25, 2019 at 4:50

1 Answer 1


Try below code

<input type="hidden" id="test" name="test"  data-bind="value: test">

Review https://mage2.pro/t/topic/597

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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