我们如何编辑下面的代码以将此功能绑定到myLink
和myButton
。将JQuery绑定到多个对象的功能
if (section === x) {
myButton = $("#a");
myLink = $("#b");
} else {
myButton = $("#c");
myLink = $("#d");
}
myLink.click(function(e) {
e.preventDefault();
showMyDialog();
});