D
DanWeaver
Hi Herbert,
Yes thats exactly it- I don't want absolute references-
I think I have to go with:
function hmmfunc(ref)
{
var moo = ref.parentNode.id;
var x=document.getElementById(moo).getElementsByTagName('input');
x[0].value="newvalue"
}
I get script errors for references like var x=moo.childNodes; or
var x= moo.getElementsByTagName('input'); or var x=
document.moo.getElementsByTagName('input');
I know the above solution will be anathema to Thomas- he rightly
points out that Im finding the parent and then finding it again, but I
have spent hours on this little piece of code alone and have about 100
other similar pieces to sort out.
The principal reason I dont like my (or your!) solution Herbert is
that I ALREADY KNOW the element (by name) within the div that I want-
it seems crazy to create an array of either all child nodes or all of
a particular tagname to then extract the wanted element when you know
the element name.
D
Yes thats exactly it- I don't want absolute references-
I think I have to go with:
function hmmfunc(ref)
{
var moo = ref.parentNode.id;
var x=document.getElementById(moo).getElementsByTagName('input');
x[0].value="newvalue"
}
I get script errors for references like var x=moo.childNodes; or
var x= moo.getElementsByTagName('input'); or var x=
document.moo.getElementsByTagName('input');
I know the above solution will be anathema to Thomas- he rightly
points out that Im finding the parent and then finding it again, but I
have spent hours on this little piece of code alone and have about 100
other similar pieces to sort out.
The principal reason I dont like my (or your!) solution Herbert is
that I ALREADY KNOW the element (by name) within the div that I want-
it seems crazy to create an array of either all child nodes or all of
a particular tagname to then extract the wanted element when you know
the element name.
D