$(document).ready(function()
{
$("#cover img").click(function(event)
{
var selected_script = $(this).attr('id');
//alert(selected_script);
//alert('#run_'+selected_script);
$('#run_'+selected_script).hide();
});
});
<div>
<img id="run_0" src="play.png" />
</div>
Code above doesn’t hide image when clicked. When I alert I get correct value for the ID.
What am I missing?
thanks
1 Answer