开发者

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

开发者 https://www.devze.com 2023-01-02 00:24 出处:网络
It's difficult to tell what 开发者_开发技巧is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form.
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

精彩评论

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