Use .data() instead of .attr() / Optimized conditions / Prevent that both options are ticked at the same
time