JS:使用JQuery通过后代选择器触发方法
Copyright Notice: This article is an original work licensed under the CC 4.0 BY-NC-ND license.
If you wish to repost this article, please include the original source link and this copyright notice.
Source link: https://v2know.com/article/934
JS:使用JQuery通过后代选择器触发方法
HTML部分:
<div id="myDiv">
<button>点击我</button>
</div>
JQuery部分:
$("#myDiv button").click(function() {
alert("Hello World!");
});
This article was last edited at 2023-05-10 06:39:00