开发者

How to get id of element in jquery dynamically [closed]

It's difficult to tell what 开发者_开发技巧is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago.

i have code like this

function slideelement(element1)
{
  $("#"+element1).slidein();
}

it is not working


It is not slidein() but slideDown():

function slideelement(element1)
{
  $("#" + element1).slideDown();
}


If you are passing in a DOM element, you can just wrap it with a jQuery object like so:

function slideelement(element1)
{
  $(element1).slideDown();
}

If you're passing in an ID string, then the code you have should be working and you're probably passing an incorrect string.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜