I currently have:
if ($(this).data('action') == "Editing" || $(this).data('action') == "Create") {
tinyMCE.init(window.tinyMCEOptions);
}
What I need to do is to check for “Create Menu” or “Create Referene”. Basically any data starting with the word “Create”.
How can I do this with a wildcard?
If these are attributes of the element (as far as we know, it’s
this), then you can use this:$(this).is("[data-action^='Create']")will check if thedata-actionattribute of the returned element(s) starts with the stringCreate. It will returntrueorfalse. We’re using the attribute starts with selector.