How to get id of element in jquery dynamically [closed]
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.
精彩评论