I have some divs that have a class modal- and a state name so it they look like this class="modal-Texas hide". And in the array for Texas it is like this "US-TX": {"location": "Texas"}.
I am trying to find all divs first with the modal- class and split just the state name out and then match up to the array location name and then build a new array with only the "US-TX" or others that matched based on location.
Full code can be found here
http://jsfiddle.net/abennington/ymgkkuzL/225/
Then once i have the new array would like to use that new array like so
onRegionOver: function (event, code) {
if (stateHTML[code]) {
$('#jvectormap1_' + code).css('cursor', 'pointer');
} else if (code) { //if a state is not specified in var stateRedirects then prevent default
event.preventDefault();
}
},
But the stateHTML[code] would be the NEWARRAY[code]
EDIT:
My modal HTML is structured like:
<div class="modal-California hide">
<div class="modal-content">
<div class="col-md-6">
<img alt="" src="healthplanalliance.org/assnfe/images/Adventist.jpg"; />
<br>
<strong>
<a href="/assnfe/cv.asp?ID=">Adventist Health Plan</a>
</strong>
<br> Roseville, California United States of America
<br> Telephone:
<br> Local Time :
</div>
</div>
</div>