Hi all, I’m certain this is possible, i just cant seem to find the answer anywhere, How do you target a specific word in an array of strings? I have found various examples for how to target a word in a string, but i am not using a string, I am using an array of strings.
this is my array:
var sec = ["10% bonus on your next order! Use " + “KEYCODE: TEN”, "15% bonus on your next order! Use " + “KEYCODE: FIFTEEN”,
"Free Shipping bonus on your next order! Use " + “KEYCODE: FREE SHIPPING”, "10% bonus on your next order! Use " + “KEYCODE: TEN”, "25% bonus on your next order! Use " + “KEYCODE: TWENTY-FIVE”, "Free Shipping bonus on your next order! Use " + “KEYCODE: FREE SHIPPING”];
I want to be able to find (target) a particular word in the array ( say KEYCODE for sake of example), and
then create a var and an html() method that outputs that word as a separate answer.
I know how to write the var and .html() method, what I am unfamiliar with is how to write the codebase that can find the particular word (in this case KEYCODE) in my array of strings.
I could be over thinking it and maybe it is possible to use the various javascript/JQuery string examples?
Thanks in advance for any help or lead