WilliamLou
WilliamLou

Reputation: 1904

simple question about jquery selector

for example, if I have:

var $target = $("div#target");

and then, I would like to pass this jquery object $target to another javascript function I defined myself, like:

 function f(xml, $div_t)
  {

  }

inside the function f, is there someway I can retrieve the original div's ID from the object $div_t?

Upvotes: 0

Views: 93

Answers (1)

Jarrett Widman
Jarrett Widman

Reputation: 6419

$div_t.attr("id")

Upvotes: 5

Related Questions