Jquery find all ids starting with a string?

Use the attribute-starts-with selector:

$('[id^="content_"]').hide();

To limit the search to elements within extra_content:

$('#extra_content [id^="content_"]').hide();

Leave a Comment