/ Published in: JavaScript

How to create a custom “:checked†pseudo selector for use in MooTools. It is just a small snippet but I’ve found it incredibly useful.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Selectors.Pseudo.checked = function(){ return (this.get('tag') == 'input' && (this.get('type').toLowerCase() == 'radio' || this.get('type').toLowerCase() == 'checkbox') && this.checked); };
URL: http://davidwalsh.name/checked-pseudo-selector-mootools
Comments
