My last childnode is an img and is undefined according to firebug.
Can I do this?
[syntax=javascript]
this.parentNode.parentNode.parentNode.parentNode.previousSibling.childNodes.childNodes.src = "/assets/img/icons/process.png";
[/syntax]
Set src of a childNode?
Re: Set src of a childNode?
It would probably be easier to access the element you want by giving it an ID and using getElementById
would that be possible ?
would that be possible ?
-
- Posts: 165
- Joined: Fri May 06, 2011 5:02 pm
Re: Set src of a childNode?
jacek wrote:It would probably be easier to access the element you want by giving it an ID and using getElementById
would that be possible ?
Unfortunately that is not possible since the element is in a dynamic array
-
- Posts: 165
- Joined: Fri May 06, 2011 5:02 pm
Re: Set src of a childNode?
fixed... yay
Re: Set src of a childNode?
unemployment wrote:fixed... yay
Good news... care to share the solution with us for people googling ?
-
- Posts: 165
- Joined: Fri May 06, 2011 5:02 pm
Re: Set src of a childNode?
jacek wrote:unemployment wrote:fixed... yay
Good news... care to share the solution with us for people googling ?
[syntax=javascript] this.parentNode.parentNode.parentNode.parentNode.previousSibling.childNodes.childNodes.src = "/assets/img/icons/process.png";[/syntax]
Needed to be...
[syntax=javascript]
this.parentNode.parentNode.parentNode.parentNode.previousSibling.firstChild.firstChild.src = "/assets/img/icons/process.png";
[/syntax]
to fit my situation