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