Javascript Ajax jQuery Html PHP Example Quiz New MORE
Need a Website Or Web Application.Contact : +91 9437911966 (Whatsapp) Note: Paid Service

How to add required attribute to an input box jquery


			Add a required attribute to an input field 
		<script src = 
	<body style = "text-align:center;"> 
		<p style = "font-size: 15px; font-weight: bold;"> 
			Click on the button to add the required attribute.
		Name: <input type="text" name="input_field" /> 
		<button id="submit"> 
			click here 
			<p id = "GFG_down" style = 
			"color: green; font-size: 20px; font-weight: bold;"> 
			 $('input').attr('required', true); 
                        = "Required attribute enabled"; 
Run it Yourself »