I have a gridview in its 3rd cell, there is textbox control, I am calling javascript function on onchange.
Can some body tell me why this is not working in Firefox a
Ishwar's answer of changing childNodes to children worked for me.
As ChaosPandion says, IE ignores white-space text-nodes. The following should work cross-browser:
var cell = grd.rows[rowindex].cells[3];
for (var textbox=cell.firstChild; textbox.nodeType!==1; textbox=textbox.nextSibling);
alert(textbox.value);
However, you say you are calling the function on onchange. Presumably that means the onchange event for the textbox in question. In that case the event argument in your event handler should have a pointer to the textbox. Look at the target or srcElement property. e.g.
function onChange(e) {
e = e || window.event;
var textbox = e.target || e.srcElement;
alert(textbox.value);
}