Files

16 lines
497 B
Markdown
Raw Normal View History

2018-10-12 16:00:59 -04:00
---
title: Target the Parent of an Element Using jQuery
localeTitle: Задайте родительский элемент элемента с помощью jQuery
---
## Задайте родительский элемент элемента с помощью jQuery
## Решение
```js
<script>
$(document).ready(function() {
$("#target1").parent().css("background-color", "red"); // Selects the parent of #target1 and changes its background-color to red
});
</script>
```