I have a simple checkbox along with label like below.
<input id="unreadCheck0" class="styled" type="checkbox" value="WSIO20DEMS131402">
<label for="unreadCheck0">
<a id="unread0" class="alert-link" href="javascript:loadSingleUnreadAdvisory('WSIO20DEMS131402',0,'201605','06',0);">WSIO20DEMS131402</a>
</label>
The whole code above will be dynamically inserted via javascript. Also there will be multiple check boxes like above. My objective is to make two different function call on two events.
First one, when I click check box label. I have achieved this like above.
Second one, when I click the checkbox I need to call the same function with different parameters. For example loadSingleUnreadAdvisory('WSIO20DEMS131402',1,'201605','06',0);
I can write a listener for all check boxes. But how to pass multiple parameters to that function? I can send all values inside value property with delimiter. Is there any other better approach to do this?
data-attributes and in jQuery listen to events and based on the checkbox clicked you can get all thedata-attributes