$(document).ready(function () { $(".block > div[class*='inner-']").click(function () { $(this).hide(); }); });