Mootools can be succesfully used to access non-existing properties and tags in your HTML document.

Sometimes there is not enough regular properties or attributes for some HTML tag, but you need to place your data into it. So you can made it up for yourself, like for example:

<option url="gmail.com" replace="google.com"></option>,

even if option tag doesn’t suport properties url and replace. Mootools access is allways the same,

option.getProperty('url').

 

You can also use some non existing HTML tag, like

<nothing else="matters"/>.

The mootools has no problem with it, for example:

alert($$('nothing')[0].getProperty('else')); 

works like magic.

 

You can also create non-existing tags, like:

var n = new Element('nothing');
document.body.grab(n);
$$('nothing').setProperty('else','matters');

Have fun!

Category: Web development  | Tags: ,  | Leave a Comment