I ran into this problem a while ago - I also found that different browsers handle this differently. Chrome was the worst criminal, if I remember correctly.
This is not necessarily the best solution, but you can attach each custom attribute to them, say "isChecked", and then drop your function from this attribute as follows:
if ($("mes_sel").attr("isChecked") == "true") { ... }
As I said, this is not the best solution, since you will have to manually turn the "isChecked" attribute to stay up to date with the actual value of the flag, but it will work if it is not more elegant for you.
If you need an example of this, check out this jsFiddle:
http://jsfiddle.net/NathanFriend/GAP2j/
This turns ordinary radio buttons into switch radio buttons - I was forced to use this special attribute method because browsers use onclick events in different ways.
Nathan Friend Jun 22 2018-12-18T00: 00Z
source share