0% found this document useful (0 votes)
21 views2 pages

JQuery HandOn

Uploaded by

Ankit Mathur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views2 pages

JQuery HandOn

Uploaded by

Ankit Mathur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

---------------------DOM Manipulation------------

function login() {
var uName = $('#username').val();
var pwd = $('#password').val();
if(uName == 'admin'&&pwd=='password'){
doRedirect("home.html");
} else {
alert('You are not a valid user');
}
};

--------Animation------------------------------

function hover1(){
$("#item1-des").slideToggle();
};
function hover2(){
$("#item2-des").slideToggle();
};
function animate_big(){
$("#buy").animate({
width: "200px",
});
};
function animate_small(){
$("#buy").animate({
width: "100px",
});
};

---------------------AJAX--------------------

function load_des() {
$('#item1-des').load('https://gist.githubusercontent.com/frescoplaylab/
8458dd75a120cf0cfbdf45be813d8f03/raw/84784527d760ef1f877f0b4bb02a3a5e12e32f4c/
file.html');

};

------------Event Handling-------------------

function login() {
var uName = $('#username').val();
var pwd = $('#password').val();
if(uName == 'admin'&&pwd=='password'){
alert('You are a valid user');
} else {
alert('You are not a valid user');
}
};

----------Addition of Two Numbers-------------------

function add() {
var num1 = $('#num1').val();
var num2 = $('#num2').val();
var total = parseInt(num1) + parseInt(num2);
$('#total').val(total);

};

------------------------------------------------------------

You might also like