Altering elements made with innerHTML

Ixonal

New Member
Messages
29
Reaction score
0
Points
0
I'm workin on my website with AJAX and I want to create the menu on the server side, and just chunk that code into the navBar.innerHTML variable with javascript. Thing is, after I do that I want to alter properties of the menu objects. So I guess my question is are elements added to a page through innerHTML added to the DOM as well?

if not, I can always just send back raw data and construct the elements client side, it's just more annoying that way.
 

dickey

New Member
Messages
128
Reaction score
0
Points
0
yes. it will be added to the dom tree and you will be able to traverse it using one of the many ways.
 

Ixonal

New Member
Messages
29
Reaction score
0
Points
0
ok, so I should be able to use getElementById() to get 'em? See, I had tried something like this before and I couldn't use appendChild() on the elements added in this way, so I was thinking there would be a function to reform the DOM or something. Oh well, I'll try this out this way and get back if it doesn't work out.
 

dickey

New Member
Messages
128
Reaction score
0
Points
0
So I guess it worked right? just note that appendChild() should work though do you have a code you have been working on?
 
Top