Category «Web Development»

How to use get & post methods in Jquery

I am going to use get method, usually we work on get and post method so Jquery has two methods for sending data from browser to server & receiving data from server $ .get() & $.post() . We can also use these methods for AJAX REQUEST . The basic syntax of post & get method …

How to do form validation in javascript

The validation part of javascript is very easy This below code block is doing validation if(name == “”) { printError(“nameError”, “Please enter your name”); } else { var regex = /^[a-zA-Z\s]+$/; if(regex.test(name) === false) { printError(“nameError”, “Please enter a valid name”); } else { printError(“nameError”, “”); nameError = false; } } If you run this …

Move object using javascript

imgObj.style.left = ‘0px’; It is used to set object at left side with zero px . imgObj.style.left = ‘100px’; If you set 100px; then it will leave 100px from left side imgObj = document.getElementById(‘img’); imgObj is a variable and storing img id ( id = “img”) function moveRight() { imgObj.style.left = parseInt(imgObj.style.left) + 100 + …

How to use accordion in Jquery

Accordion is like a tab which hold paragraph or any contents . It is expandable and collapsible , it broken into many sections If you run this code in your browser output :

Add Remove class using Jquery UI

addclass() method used to change css properties .This is the syntex of addClass method :- .addClass( className [, duration ] [, easing ] [, complete ] )  Explanation of syntex 😛 ClassName: It is a string which contains CSS classes. Duration:This is used to for time duration. 1000 miliseconds it means you have set 1 second 2000 – > 2 Seconds ,10000 Miliseconds ->10 Seconds. If you …

JQuery UI Toggle

The toggle() method toggles between hide() and show() for the selected elements If you run this code your output :- Check our more tutorials on PHP and JQuery

How to get area of traingle using PHP Code

Area of traingle is calculated by this formula : –(base * height) / 2 = Area If you run this code in your browser Output:- Base of Traingle: Height of Traingle : How to get armstrong number using PHP Code See more tutorials on php

Check perfect number using PHP Code

This is interview question .How to check a entered number is a perfect number of not Output of the code : I have taken 13 so it will give this output :- Your enterded number is not a Perfect Number How to print a traigle using PHP Code :- We can print stars traingle using …

Hide & Show paragraph using jquery

We can show and hide paragraph using hide() show() method $(“.btnHide”).click(function(){ This line of code will hide paragraph & .btnHide is class name of button . If you use id then your code would be like this $(#btnHide).click(function(){ becuase we use (#) this sign for id. Now we will see another example just copy the …