Bladephp: Now with 7+ codeigniter, php, and laravel project 7+ php project From $18/Year From Rs. 1000/Year

How to 'undefined' value and generate alert using jQuery

javascript jquery
How to 'undefined' value and generate alert using jQuery

JQuery library was developed specifically to simplify and to unify certain JavaScript functionality. However if you need to check a variable against undefined value, there is no need to invent any special method, since JavaScript has a typeof operator, which is simple, fast and cross-platform.

<script type="text/javascript">
		var testing_fuel_check  = $('.testing_fuel_check').val();
		if(typeof testing_fuel_check === "undefined")
			alert('Please complete Fuel Sales after than complete testing!!');


Html code work in comment box

Related Post