Click here to Skip to main content
15,913,465 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
my client id of an element is

CphrEMS_dlbooks_tblitems_0;



when i Call fadeout in funtion with $(CphrEMS_dlbooks_tblitems_0).fadeOut()

its working fine

but if i try like this :


var tbl = "CphrEMS_dlbooks_tblitems_" + 0;

$(tbl).fadeOut() its not working.

how to make use of variable to call a function in jquery


i need to loop so it should be dynamic
Posted
Comments
oliver grace 22-May-14 6:02am    
Variable does not have fadeOut() menthod.you cant use fadeout()method to var.
Member 10690248 22-May-14 6:08am    
but the same code is working fine in javascript . By using document.gelElememntByID

1 solution

Try this:
var tbl = "#CphrEMS_dlbooks_tblitems_" + 0;
 
Share this answer
 
Comments
Member 10690248 22-May-14 7:10am    
You are genius

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900