EKsumic's Blog

let today = new Beginning();

Click the left button to use the catalog.

OR

JS:使用JQuery通过后代选择器触发方法

JS:使用JQuery通过后代选择器触发方法

 

HTML部分:

<div id="myDiv">
  <button>点击我</button>
</div>

 

JQuery部分:

$("#myDiv button").click(function() {
  alert("Hello World!");
});

 

返回:[目录] JavaScript基础:方法触发相关

This article was last edited at 2023-05-10 15:39:00

* *