So I wrote the javascript function below which will only return an element node (node type of 1).
function getNextElement(srcElement) {
var nextElement = srcElement.nextSibling;
while (nextElement.nodeType != 1) {
nextElement = nextElement.nextSibling;
}
return nextElement;
}
var nextElement = srcElement.nextSibling;
while (nextElement.nodeType != 1) {
nextElement = nextElement.nextSibling;
}
return nextElement;
}
No comments:
Post a Comment