What is JQUERY? Illustrate the use of JQUERY with a program

Mumbai University > Information Technology > Sem 4 > Web Programming

Marks: 10M

Year: May 2014, May 2015

1 Answer
  • JQuery library is created by John Rosig in 2006. It is a Javascript library.
  • The purpose of JQuery is to write less do more.
  • JQuery adds up many advanced, cross browser functions to standard language.
  • There are two ways to execute JQuery:
    • Downloading JQuery library from jquery.com
    • Mentioning the URL to download JQuery library in a script tag


  • It is cross platform compatibility. It works on all platforms.
  • It is lightweight about 19kb in size.
  • It support abandon animation effects to make web document attractive.
  • It supports AJAX technology.
  • It supports DOM manipulations. One can select DOM elements, traverse them and modify their contents using JQuery.


  • JQuery can be used from the Internet or from downloaded JQuery library file.
  • JQuery must be coded in support of Javascript, PHP, ASP and AJAX to get advantage of its library functions
  • One of the major uses of JQuery is form Validation. JQuery eliminates the lengthy and complicated code in Javascript for form validation.
  • This is done in JQuery easily with the help of built invalidation function.
  • To achieve this, jquery.validate plugin will be needed.

    <script src=”https://ajax.googleapps.comajax/libs/jquery/1.10.2/jquery.min.js>       </script>
    <script src=”https://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js”></script>
  • The validate() function will be part of ready function in the script tag. This function is used to define rules and messages

Validate function

        rules for field 1
            attribute: value;
            attribute: value;
messages: {
            field name 1: { attribute : your definition };
            field name 2: { attribute : your definition };

HTMl File:

<script src=”https://ajax.googleapps.comajax/libs/jquery/1.10.2/jquery.min.js></script>
<script src=”https://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js”></script>
    		$(‘#myform’).validate({//initialize the plugin
rules: {
email id:{
        required: true,
    required: true,
    name: {required:“Please enter your name”},
    email id: {email:”Please enter a valid email id”},
    phone: {minlength: “Please enter 10 digit phone number”}
<form id=”myform” method=”post”>
    <td><input type=”text” name=”name”/></td>
    <td>Email id</td>
    <td><input type=”text” name=”emailid”/></td>
    <td>Phone number</td>
    <td><input type=”text” name=”phone”/></td>
<td><input type=”submit”/></td>
Please log in to add an answer.