Select box validation using JQuery

In this article i will show you how to validate select box using JQuery. Example of select box validation using JQuery. First to get the id of the select box then get the value of it.

Source Code

<!DOCTYPE html>
<html xmlns="">
    <script src="Scripts/jquery-1.10.2.js"></script>
        $(function () {
            $("#Button1").click(function () {
                var a = $("#d1").val();
                    alert("Please select");


    <select name="d11" id="d1">
        <option value="0" >Select</option>
        <option value="1">Apple</option>
    <input id="Button1" type="button" value="button" />

Code generate the following output

Select box validation using JQuery


Popular posts from this blog

difference between structure and union in C Language

Difference between Linear search and Binary Search in c language

Difference between static and dynamic websites