Files
freeCodeCamp/guide/chinese/miscellaneous/change-the-css-of-an-element-using-jquery/index.md
2018-10-16 21:32:40 +05:30

16 lines
348 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Change the CSS of an Element Using jQuery
localeTitle: 使用jQuery更改元素的CSS
---
我们也可以使用jQuery直接更改HTML元素的CSS。
Query有一个名为`.css()`的函数它允许您更改元素的CSS。
```
<script>
$(document).ready(function() {
$("#target1").css("color", "red");
});
</script>
```