J Query
J Query
function add() {
var a=parseInt($("#num1").val());
var b=parseInt($("#num2").val());
var sum=a+b;
$('#total').val(sum)
};
hands on 2 -
if ($("#username").val() == "admin" && $("#password").val() == "password") {
alert("You are a valid user");
} else {
alert("You are not a valid user");
}
hands on 3 -
function login() {
if ($("#username").val() == "admin" && $("#password").val() == "password") {
doRedirect("home.html")
} else {
alert("You are not a valid user");
}
};
function doRedirect(href) {
window.location.href = href;
};
hands on 4 -
function hover1(){
$("#items1-des").slideToggle();
};
function hover2(){
$("#items2-des").slideToggle();
};
function animate_big(){
$("#buy").animate({width: "200px"});
};
function animate_small(){
$("#buy").animate({width: "100px"});
};
hands on 5 -
function load_des() {
$('#item1-
des').load("https://gist.githubusercontent.com/frescoplaylab/8458dd75a120cf0cfbdf45
be813d8f03/raw/84784527d760ef1f877f0b4bb02a3a5e12e32f4c/file.html");
};