Js allow and not allowed more then 100 value

Js allow and not allowed more then 100 value function

by Ankit Patidar

HTML

<h4>Allow and not allowed more then 100 value</h4>
<select id="selectBox">
    <option value="0">Not allowed</option>
    <option value="1">Allow</option>
</select>
<input type="text" id="inputBox">

CSS

body{font-family:"Myriad Pro",arial}

JavaScript

$("#inputBox").keyup(function(){
	if($("#selectBox").val() == "0"){
		if(parseInt($(this).val()) > 100){
			$(this).val("100");
		}
	}
});
$("#selectBox").change(function(){
	if($(this).val() == "0"){
		if(parseInt($("#inputBox").val()) > 100){
			$("#inputBox").val("100");
		}
	}
});