New to Kendo UI for jQuery? Start a free 30-day trial

Value

methods

Gets or sets the value of the widget.

Important: This method does not trigger the change event.

This can affect MVVM value binding. The model bound to the widget will not be updated. You can overcome this behavior triggering the change event manually using trigger("change") method.

Parameters:valueString

The value to set.

Returns:String

the value of the widget.

<input id="otpinput" />
<script>
    $("#otpinput").kendoOTPInput({
        items: 3
    });

    var otpInput = $("#otpinput").getKendoOTPInput();
    otpInput.value("123");
    otpInput.trigger("change")
</script>
<<input id="otpinput" />
<script>
    $("#otpinput").kendoOTPInput({
        items: 3,
        value: "foo"
    });
    var otpInput = $("#otpinput").getKendoOTPInput();
    var value = otpInput.value();
/* The result can be observed in the DevTools(F12) console of the browser. */
    console.log(value); // Displays "foo"
    otpInput.value("123");
    value = otpInput.value();
/* The result can be observed in the DevTools(F12) console of the browser. */
    console.log(value); // Displays "123"
</script>
Not finding the help you need?
Contact Support