public
Last active — forked from Kevnz/yui3-dom.js

  • Download Gist
yui3-dom.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
var YUI = require('yui3').YUI,
fs = require('fs');
 
var filename = 'foo.html';
 
var result = fs.readFileSync(filename, "utf8");
YUI({loadOptional: true}).use('node', function(Y) {
 
Y.one('doc').set('innerHTML', result);
 
var idSelector = 'div#test-id';
var classSelector = 'div.test-case';
var idContainer = Y.one(idSelector);
var classContainer = Y.one(classSelector);
if(idContainer === null){
console.log('The ID Selector is null');
}
if(classContainer !== null){
console.log('The Class Selector is not null');
}
});

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.