else if (type == "string") {
if (doc == undefined)
doc = document;
- if (arg.charAt(0) == '#')
- return new $([doc.getElementById(arg.substring(1))]);
- else if (arg.charAt(0) == '.')
+ if (arg.charAt(0) == '#') {
+ var node = doc.getElementById(arg.substring(1));
+ return $(node == null ? [] : [node]);
+ } else if (arg.charAt(0) == '.')
return new $(doc.getElementsByClassName(arg.substring(1)));
else
return $([doc]).descendants(arg);
}
},
+ src: {
+ get: function (node) {
+ return node.src;
+ },
+ set: function (node, value) {
+ node.src = value;
+ }
+ },
+
value: {
get: function (node) {
return node.value;