Files
freeCodeCamp/guide/chinese/miscellaneous/change-text-with-click-events/index.md
2018-10-16 21:32:40 +05:30

10 lines
385 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 Text with Click Events
localeTitle: 使用Click事件更改文本
---
当发生click事件时我们可以使用Ajax使用以下代码更新HTML元素
```
$(".message").html("Here is the message");
```
这告诉jQuery使用类`message`作为选择器为此更改HTML以使字符串提供我们还可以添加用引号括起来的自定义html元素。