[DOM]inhoud anchor

Pagina: 1
Acties:

  • paragon
  • Registratie: April 2000
  • Laatst online: 23-08 17:24
Ik porbeer via een simpele functie de inhoud van een anchor te krijgen:

<a href="" onclick="alert(this.childNodes); return false;">tekst</a>

ik wil dus "tekst" in de alert box krijgen... ik krijg nu alleen [object]

[ Voor 20% gewijzigd door paragon op 30-01-2003 15:33 ]


  • disjfa
  • Registratie: April 2001
  • Laatst online: 12-05 15:11

disjfa

be

this.innerHTML

voor meer info en voorbeelden www.getelementbyid.com

disjfa - disj·fa (meneer)
disjfa.nl


  • paragon
  • Registratie: April 2000
  • Laatst online: 23-08 17:24
thnx maar is er nog een optie buiten innerHTML want das niet zo netjes toch?

  • BtM909
  • Registratie: Juni 2000
  • Niet online

BtM909

Watch out Guys...

paragon schreef op 30 januari 2003 @ 15:44:
thnx maar is er nog een optie buiten innerHTML want das niet zo netjes toch?
Hoezo niet?

Ace of Base vs Charli XCX - All That She Boom Claps (RMT) | Clean Bandit vs Galantis - I'd Rather Be You (RMT)
You've moved up on my notch-list. You have 1 notch
I have a black belt in Kung Flu.


  • drm
  • Registratie: Februari 2001
  • Laatst online: 09-06-2025

drm

f0pc0dert

alert ( this.firstChild.nodeValue )
Hoezo niet?
Omdat innerHTML geen DOM is :)

Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz


  • BtM909
  • Registratie: Juni 2000
  • Niet online

BtM909

Watch out Guys...

drm schreef op 30 januari 2003 @ 16:00:
alert ( this.firstChild.nodeValue )


[...]

Omdat innerHTML geen DOM is :)
hmmppfff |:( Ik dacht ff dat het ergens anders op sloeg :P

Had [DOM] niet gezien in de titel.

Ace of Base vs Charli XCX - All That She Boom Claps (RMT) | Clean Bandit vs Galantis - I'd Rather Be You (RMT)
You've moved up on my notch-list. You have 1 notch
I have a black belt in Kung Flu.


  • disjfa
  • Registratie: April 2001
  • Laatst online: 12-05 15:11

disjfa

be

en van welke is innerHTML dan weer?

disjfa - disj·fa (meneer)
disjfa.nl


  • drm
  • Registratie: Februari 2001
  • Laatst online: 09-06-2025

drm

f0pc0dert

disjfa:
en van welke is innerHTML dan weer?

:?

Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz


Verwijderd

van microsoft toch? anyways innerText it is

  • drm
  • Registratie: Februari 2001
  • Laatst online: 09-06-2025

drm

f0pc0dert

Ook dat is dus geen DOM, en innerHTML is voor zover ik weet inderdaad een Microsoft verzinsel... Dat mozilla daar af en toe achteraan loopt is soms handig, soms ook vervelend voor de pioniers van de standaarden :)

En een standaarden discussie ga ik niet houden als je 't niet erg vindt :D

Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz


Verwijderd

nodeValue zou volgens w3schools moeten werken, maar daar krijg ik geen resultaat mee eigenlijk, rara wie weet het antwoord?

  • disjfa
  • Registratie: April 2001
  • Laatst online: 12-05 15:11

disjfa

be

drm schreef op 30 January 2003 @ 18:37:
Ook dat is dus geen DOM, en innerHTML is voor zover ik weet inderdaad een Microsoft verzinsel... Dat mozilla daar af en toe achteraan loopt is soms handig, soms ook vervelend voor de pioniers van de standaarden :)
dan je wel :)

disjfa - disj·fa (meneer)
disjfa.nl


  • drm
  • Registratie: Februari 2001
  • Laatst online: 09-06-2025

drm

f0pc0dert

mophor
drm schreef op 30 januari 2003 @ 16:00:
alert ( this.firstChild.nodeValue )

joehoe!
dank je wel
np

[ Voor 17% gewijzigd door drm op 30-01-2003 19:39 ]

Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz


Verwijderd

:X dat was 4 uur vanmiddag, toen was ik nog niet wakker, stom dat ik er nooit aan heb gedacht dat die text natuurlijk een textnode is.

  • drm
  • Registratie: Februari 2001
  • Laatst online: 09-06-2025

drm

f0pc0dert

mophor:
:X dat was 4 uur vanmiddag, toen was ik nog niet wakker
:D ;)
stom dat ik er nooit aan heb gedacht dat die text natuurlijk een textnode is.
[/nohtml]:X :P

Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz

Pagina: 1