value
Gets or sets the value of the PromptBox.
Parameters
value String
The value to set. If omitted, the method returns the current value.
Returns
String The value of the PromptBox when called without parameters.
Example - Get value
<div id="promptbox"></div>
<button id="get-value">Get Value</button>
<script>
var promptbox = $("#promptbox").kendoPromptBox({
value: "Hello world",
placeholder: "Type something..."
}).data("kendoPromptBox");
$("#get-value").click(function() {
alert("Current value: " + promptbox.value());
});
</script>
Example - Set value
<div id="promptbox"></div>
<button id="set-value">Set Value</button>
<script>
var promptbox = $("#promptbox").kendoPromptBox({
placeholder: "Will be updated..."
}).data("kendoPromptBox");
$("#set-value").click(function() {
promptbox.value("New value set programmatically");
});
</script>