views:

1163

answers:

1

I have a lot of <span> tags like this <span id='val_Title'></span> <span id='val_Name'></span>

I would like to return all the elements that begin with 'val_' and hide them.

How can I do this? Thanks

+9  A: 

Use attribute selectors

$(document).ready(function(){
   $("span[id^='val_']").hide();
});
Rafael