Anyone help with this jQuery I'm trying to pull off I can't get the regex to work
cj("input[id='PRE_TEXT_'(.*)'_POST_TEXT']").hide();
You can't use regex in jQuery selectors. Use the filter function:
cj("input").filter(function() {
if (/^PRE_TEXT_(.*)_POST_TEXT$/.test(cj(this).prop("id"))) {
return true;
}
return false;
}).hide();
You can't use regex, but you should be able to use startswith and endswith.
cj("input[id^='PRE_TEXT_'][id$='_POST_TEXT']").hide();
$.filter()and use your regex in the function you pass to it.