- <html>
- <head>
- <meta http-equiv="Content-type" content="text/html; charset=utf-8">
- <title>selectors</title>
- <script src="mootools-1.2.1-core-nc.js" type="text/javascript" charset="utf-8"></script>
- <script src="mootools-1.2-more.js" type="text/javascript" charset="utf-8"></script>
- <style type="text/css" media="screen">
- .head {
- padding: 5px;
- width: 100px;
- height: 100px;
- margin: 5px;
- border: 3px solid black;
- }
- .head[hair="yellow"] {
- background: yellow;
- }
- .head[hair="forest green"] {
- background: #869B27;
- }
- </style>
- <script type="text/javascript" charset="utf-8">
- window.addEvent('domready', function(){
- $$('.head[hair="forest green"]').each(function(item){
- item.set('text', "i have forest green hair!");
- });
- $$('.head[hair="yellow"]').each(function(item){
- item.set('text', "i have yellow hair!");
- });
- });
- </script>
- </head>
- <body>
- <div class="head" hair="yellow"></div>
- <div class="head" hair="forest green"></div>
- </body>
- </html>
So there seems to be a bug with selectors when there is a space in the attribute value. the color is filled in by the css and the words are filled in by mootools. As you can see, they both have color, but the "forest green" one doesn't have the text. I'm using the same exact selector for mootools as I am css.
QUE??


