Run through multiple data types using jQuery
Hi, im not sure if its possible however Im trying to work out a way that run through a bunch of data-types and change text based on it. I know you can do it by writing every data-type and then editing the related class. However I plan to have loads of data-types and therefore looking for a time saving solution.
So my plan is to have lots of information linked to a certain div, this is so when click it can update a information section based on the data. All of the data-types will have the same data-test-
<div class="box" data-test-1="1.1" data-test-2="1.2" data-test-3="1.3"></div> <div class="box" data-test-1="2.1" data-test-2="2.2" data-test-3="2.3"></div> <div class="box" data-test-1="3.1" data-test-2="3.2" data-test-3="3.3"></div>
Is the away I can use jQuery to run through all of the data-test-"" when the box is clicked and then link them to a match ID.
Simplified version - https://jsfiddle.net/gaLLms9b/2/