You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

320 lines
8.7 KiB
JavaScript

/**
}
10 years ago
if(obj.length == 1){
* @pre jx.dom.exists(id)
* @post: none
*/
jx.dom.get.attribute = function(id,field){
_dom = jx.dom.get.instance(id)
return _dom.getAttribute(field) ;
}
/**
* This function returns a list of children nodes provided an existing node identifier
* @pre : jx.dom.exists(id) || jx.dom.get.instance(id) != null
* @post: jx.dom.get.children(id).length >= 0
* @param {type} id
* @returns {Array|list}
*/
jx.dom.get.children = function(id){
list = [] ;
if(id.constructor == String){
nodes = document.getElementById(id).childNodes ;
}else{
nodes = id.childNodes;
}
for(var i=0; i < nodes.length; i++){
node = nodes[i];
if(node.nodeName.match('^#.*') == null){
list.push(node) ;
}
}
return list ;
}
}
_dom.setAttribute(field,value) ;