jQuery qtip() - 如何从点击的项目中获取id

use*_*973 2 jquery qtip

我在我的asp.net页面中有jQuery qtip()函数,我需要从点击的项目中获取id.有谁知道怎么做?

作为示例,请在下面找到我的脚本代码...

$("#content a.toolTip").qtip({
     content: { url: 'PageView.aspx?Param=' + '---get id---'  }
)};
Run Code Online (Sandbox Code Playgroud)

提前致谢.

[]'RPG

use*_*716 6

如果你想this在设置qtip时引用元素,你可以在一个内部进行设置.each().那种方式this指的是当前元素.

$("#content a.toolTip").each(function() {
        // Now "this" is a reference to the
        //    element getting the qtip
        // Get the ID attribte -------------------------------v
    $(this).qtip({ content: { url: 'PageView.aspx?Param=' + this.id } });
});
Run Code Online (Sandbox Code Playgroud)