Input field blur value set

Input field blur value set value 0

by Ankit Patidar

HTML

<input id="check1" type="text" class="quantityinput" value="0">

JavaScript

$(document).ready(function(){
  $("input.quantityinput").blur(function () {
		alert("1");
		if($("input.quantityinput").prop("value") == ""){
			alert("2");
			$("input.quantityinput").prop("value", "0");	
			
		}
	});
});