jQuery Basic

jQuery is a JavaScript library.

The purpose of jQuery is to make it much easier to use JavaScript on the website.

jQuery syntax is tailor made for selecting HTML elements and performing some action on the element

ex-

$(“selector”).action()

. A $ sign to define/access jQuery

. A (selector) to query (or find) HTML page

. A jQuery action() to be perform need an elements

$(this).hide() – hides the current element .

$(“p”).hide()- hides all the <p> elements .

$(“.test”).hide()- hides all elements with class =”test” .

$(“#test”).hide()- hides all elements with id =”test” .

The Document Ready Event

$(document).ready(function)

{

// jQuery methods go here

}

This is to prevent any jQuery code from running before the document is finshied loading is ready.

$(document).ready(function()

{

$(“button”).click(function()

{
$(“p”).hide();

});

});

Related Posts

JAVA SCRIPT VARIABLE AND DATATYPE.

What is Variable ? Variable is just like a container which store the value into it . ex- var x=6; let y=x+z; In above example x and…

Read More

JavaScript Intro And Basic

JavaScript JS is a part of web page that’s defines all the action perform on the web pages. JS is a programming language with oop concepts. JS…

Read More

PHP | Data Types

In PHP, Data types are used to declare one particular type of data as in all programming languages. Data Types define the type of data a variable…

Read More

Why PHP Is Still So Important for Web Development?

PHP (Hypertext Preprocessor) is a general-purpose scripting language that can be used to develop dynamic websites. It was from the first server-side languages that could be embedded…

Read More

What is Loops in JavaScript?

Looping in programming languages is a feature which facilitates the execution of a set of instructions/functions repeatedly while some condition evaluates to true. For example, suppose we…

Read More

What is JavaScript?

JavaScript is a scripting or programming language that allows you to implement complex features on web pages every time a web page does more than just sit…

Read More