Sale is live! Enjoy 70% Off! Use Credit/Debit Cards in India and PayPal outside of India for better experience!

Show hide a div on change of select box using jQuery

Learn how to show or hide a div on change of select box. All the magic is of change event. We can detect the selected value inside the change event function.

Source Code:

	div {
		background-color: yellow;
		display: none;
		text-align: center;
		width: 200px;
		height: 200px;
		margin: 50px auto;
	} {
		background-color: red;
		color: #fff;

	$(document).ready(function () {
		$("select").change(function (){
			if($(this).val() == 'yellow') {
			else if($(this).val() == 'red') {

Free - Download it right now!


Include all files

Demo Download

Reviews and Comments




excellent12 Dec, 2018 03:47 pm