how to get the id of div tag on body onload event

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mona02
Forum Newbie
Posts: 3
Joined: Thu Mar 12, 2009 11:41 am

how to get the id of div tag on body onload event

Post by mona02 »

I m using an iframe and my pages are loaded on iframe and i m using ajax for that now for e.g i have one user registration page and on this page one other page is displaying on onclick event now i want to get the id of div tag situated on this third page and on onload event cananybody tell me how to get that id
i m document.getElementById but it is comin null on onload event


thanks in advance
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: how to get the id of div tag on body onload event

Post by jaoudestudios »

Do you have a url? This will help us understand.
User avatar
php_east
Forum Contributor
Posts: 453
Joined: Sun Feb 22, 2009 1:31 pm
Location: Far Far East.

Re: how to get the id of div tag on body onload event

Post by php_east »

iframe is another window, so you need to call window of *that* frame for your javascripts.
lookup iframe window processing. document.getElements refers to current window only, not the iframe window.
Post Reply