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


/ Published in: JavaScript
Save to your folder(s)

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.


Copy this code and paste it in your HTML
  1. Selectors.Pseudo.checked = function(){
  2. return (this.get('tag') == 'input' && (this.get('type').toLowerCase() == 'radio' || this.get('type').toLowerCase() == 'checkbox') && this.checked);
  3. };

URL: http://davidwalsh.name/checked-pseudo-selector-mootools

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.