Skip to content

Instantly share code, notes, and snippets.

@codylindley
Created February 23, 2010 15:49
Show Gist options
  • Save codylindley/312324 to your computer and use it in GitHub Desktop.
Save codylindley/312324 to your computer and use it in GitHub Desktop.
dojo.NodeList.prototype.highlight = function(){
this.forEach(function(node){
dojo.style(node, “backgroundColor”, “yellow”);
});
return this;
}
dojo.query(“p”).highlight();
dojo.extend(dojo.NodeList, {
highlight: function(color){
// You can accept arguments
this.forEach(function(node){
dojo.style(node, “backgroundColor”, color || “yellow”);
});
return this;
}
});
dojo.query(“p”).highlight(“red”);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment