freeCodeCamp/guide/russian/certifications/front-end-libraries/jquery/target-html-elements-with-s.../index.md

29 lines
1.1 KiB
Markdown
Raw Normal View History

2018-10-12 20:00:59 +00:00
---
title: Target HTML Elements with Selectors Using jQuery
localeTitle: Целевые элементы HTML с селекторами Использование jQuery
---
* Селекторы JQuery позволяют вам выбирать и управлять элементами HTML.
* Эти селекторы начинаются со знака доллара и круглых скобок: $ ()
* Вы можете «найти» (или выбрать) HTML-элементы на основе их имени, идентификатора, классов, типов, атрибутов, значений атрибутов и т. Д.
## пример
```javascipt
//You can select all <p> elements on a page like this = $("p")
$(document).ready(function(){
$("button").click(function(){
$("p").hide();
});
});
```
## Решение
```javascript
<script>
$(document).ready(function() {
$("button").addClass("animated bounce"); // We are selecting the button elements and adding "animated bounce" class to them.
});
</script>
```