value

Gets or sets the value of the widget.

Important: This method does not trigger the change event. This could 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.

Important: This method does not trigger the focusout event of the input. This could affect the floating label functionality. You can overcome this behavior by manually invoking the refresh method of the Floating Label: $("#textbox").data("kendoTextBox").floatingLabel.refresh();

Parameters

value String

The value to set.

Returns

String the value of the widget.

Example - trigger the change event after setting the value

<input id="textbox" />
<script>
    $("#textbox").kendoTextBox();
    var textbox = $("#textbox").data("kendoTextBox");
    textbox.value("new value");
    textbox.trigger("change");
</script>

Example - set and get the value of the widget

<input id="textbox" />
<script>
    $("#textbox").kendoTextBox({
        value: "Oranges"
    });
    var textbox = $("#textbox").data("kendoTextBox");
    var value = textbox.value();
    console.log(value); // Displays "Oranges"
    textbox.value("Apples");
    value = textbox.value();
    console.log(value); // Displays "Apples"
</script>
In this article
Not finding the help you need? Improve this article