Html NumberInput

Set the allowNull property of the jqxNumberInput. Author: http://jqwidgets.com

by txhi

HTML

<script src="http:\\jqwidgets.com\jquery-widgets-demo\jqwidgets\globalization/globalize.js"></script>
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.energyblue.css">
<script src="http://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<div style="margin: 10px;" id='jqxNumberInput'></div>
<button style="margin: 10px;" id="jqxButton">Clear</button>

JavaScript

$("#jqxNumberInput").jqxNumberInput({
    width: '250px',
    height: '25px',
    theme: 'energyblue',
    allowNull: true,
    inputMode: 'simple'
});

$("#jqxButton").jqxButton({ theme: 'energyblue' });

$("#jqxButton").click(function () {
		$("#jqxNumberInput").val(null);
});

$("#jqxNumberInput input").keydown(function (event) {
    if (event.keyCode === 46) {
        $("#jqxNumberInput").val(null);
    }
});