# jQuery

{% embed url="<https://jquery.com/>" %}

{% embed url="<https://www.youtube.com/watch?v=UU-GebNqdbg>" %}

#### Features:

* HTML/DOM manipulation
* CSS manipulation
* HTML event methods
* Effects and animations
* AJAX
* Utilities

## Usage

```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
```

## Syntax

```javascript
$(selector).action()
```

* A `$` sign to define/access jQuery
* A `(`*`selector`*`)` to "query (or find)" HTML elements
* A jQuery `action()` to be performed on the element(s)

## Selectors

jQuery selectors allow you to select and manipulate HTML element(s).

jQuery selectors are used to "find" (or select) HTML elements based on their name, id, classes, types, attributes, values of attributes and much more. It's based on the existing CSS Selectors, and in addition, it has some own custom selectors.

* The jQuery element selector selects elements based on the element name. eg. `$("p")`
* The jQuery `#id` selector uses the `id` attribute of an HTML tag to find the specific element. eg. `$("#test")`
* The jQuery `.class` selector finds elements with a specific class. eg. `$(".test")`

## Events

<table><thead><tr><th width="156">Mouse Events</th><th width="162">Keyboard Events</th><th width="133">Form Events</th><th>Document/Window Events</th></tr></thead><tbody><tr><td>click</td><td>keypress</td><td>submit</td><td>load</td></tr><tr><td>dblclick</td><td>keydown</td><td>change</td><td>resize</td></tr><tr><td>mouseenter</td><td>keyup</td><td>focus</td><td>scroll</td></tr><tr><td>mouseleave</td><td> </td><td>blur</td><td>unload</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dailyjournal.gitbook.io/notes/languages/javascript/libraries/jquery.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
