I have a series of checkboxes in an interface that are already configured to display / hide other elements of the interface conditionally. In this same interface I have a div
set to display messages to the user also conditionally depending on the checkbox selected.
I made this example in jsfiddle based on another script, which uses .each in the function to check inputs with a certain class and "print" the label text of these inputs in another element, in this case a <span>
It happens that in the "final" interface the elements checkbox and radio are customized and use the <label>
tag to define their styles, which in turn, does not allow me to insert texts in <label>
elements and so I can not use this function ...
Would there be another, simpler and more coherent way of displaying conditional messages extracted perhaps from the data-
attribute?
Here is the code mentioned in the jsfiddle link.