Jump to content


The DOM Object

  • Please log in to reply
4 replies to this topic

#1 shocker-z

  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 16 September 2006 - 12:10 PM

I'm doin AJAX and was advised this to get 2 functions to work off 1 click to change 2 div tags at once..

"You can use The DOM Object To get the Div Tag You need and set the needed attributes in the Div Tag on the ONCLICK Event , both Can Divtags be set in a single method."

Was wondering if anyone had examples of this?

www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge

#2 Daniel0

  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 16 September 2006 - 03:24 PM

I'm not sure what is meant, but could it be something like this:

< script type='text/javascript'>
document.getelementbyid('something').onclick = function(var1,var2)
// bla bla

<div id='something'>bla bla bla bla</div>

#3 fenway

  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 20 September 2006 - 12:58 PM

You can look up as many DOM elements as you need in any given function, so I'm not sure what you're referring to.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#4 shocker-z

  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 21 September 2006 - 07:12 PM

I'm basicaly playing with AJAX and i need 2 DIVs to change when i click a link but wont work by me putting 2 functions inside a funtion for some reason..
www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge

#5 obsidian

  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 21 September 2006 - 07:17 PM

maybe if you showed us some example code and reference where it's not working, we'd be of more help
You can't win, you can't lose, you can't break even... you can't even get out of the game.

while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users