Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
例如,如果我有:
var $target = $("div#target");
然后,我想将此 jquery 对象 $target 传递给我自己定义的另一个 javascript 函数,例如:
function f(xml, $div_t) { }
在函数 f 中,有没有办法从对象 $div_t 中检索原始 div 的 ID?
$div_t.attr("id")