I want to check whether an element with the name "shape_7" is visible. When I perform the following JavaScript it works fine:
var element = shape_7;
if( $(element).is(':visible') )
{
//my code
}
However, if I perform the following JavaScript it doesn't work:
var counter = 7;
var element = 'shape_' + counter;
if( $(element).is(':visible') )
{
//my code
}
Unfortunately, I need the second case (number as variable) in my situation. How has the second code to be corrected in order to work properly?
Thank you very much in advance for any help!