2 Replies - 637 Views - Last Post: 14 May 2012 - 06:08 AM

#1 Prashant Gangwar  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 05-May 12

getElementById('light')....means?

Posted 05 May 2012 - 02:14 PM

I m posting the following script...

onclick ="document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'"...

i saw them used in a code...but i dont understand getElementById pic the element by id name...but in the code there wasnt any element named 'light' or 'fade'..
Is This A Good Question/Topic? 0
  • +

Replies To: getElementById('light')....means?

#2 Ntwiles  Icon User is offline

  • D.I.C Addict

Reputation: 148
  • View blog
  • Posts: 830
  • Joined: 26-May 10

Re: getElementById('light')....means?

Posted 05 May 2012 - 02:19 PM

Can you post the code in question? You're right in thinking that it's getting an element with the id 'light' or 'fade', but the element my be created dynamically, so there may not be something as simple as <div id='light'>.

This post has been edited by Ntwiles: 06 May 2012 - 06:02 AM

Was This Post Helpful? 3
  • +
  • -

#3 Prashant Gangwar  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 05-May 12

Re: getElementById('light')....means?

Posted 14 May 2012 - 06:08 AM

thx Ntwiles.....

but can u explain ur ans more by expanding term ' element created dynamically ' ..... is it possible to create element dynamically and then call it in javascript.....

and dynamically means in php...right....
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1