Magento – Magento 2: How to get value input with knockout Js

inputknockoutjsmagento2

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

i want using ko get value of input.
my component

define([
    'Magento_Ui/js/form/form',
    'jquery',
    'jquery/ui'
], function(Component) {
    'use strict';
    return Component.extend({
        initialize: function () {
            this._super();
            // component initialization logic
            return this;
        }
    });
});

Best Answer

Try below code

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

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

Related Topic