I’d like to make it so that based on the value of an HTML attribute in a list of HTML elements, that I can call a different javascript function based on the value of that attribute’s string value.
basically what I want is a map from string => function in javascript / jQuery. (and then of course be able to call this function).
is this possible?
Yes:
If your functions already exist, you can just reference them by name:
and you can mix the two styles.
To call one of the functions based on a value: