Skip to content

Instantly share code, notes, and snippets.

@davglass
Forked from Kevnz/yui3-dom.js
Created February 9, 2011 21:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davglass/819343 to your computer and use it in GitHub Desktop.
Save davglass/819343 to your computer and use it in GitHub Desktop.
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');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment