Posted By

ianmonge on 11/28/08


javascript selectors mootools

Versions (?)

Create a Custom “:checked” Pseudo Selector for MooTools 1.2

 / 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.

  1. Selectors.Pseudo.checked = function(){
  2. return (this.get('tag') == 'input' && (this.get('type').toLowerCase() == 'radio' || this.get('type').toLowerCase() == 'checkbox') && this.checked);
  3. };

Report this snippet  

You need to login to post a comment.