var camount =$("#amount").val($("#slider" ).slider( "value" ) ); if (camount == "[object Object]") { var camount ="0" } amount.value = camount.toString();