[JS / HTML] Using extra object properties
Slightly Wonky Robob 28 Jan 2008
How do you define / use extra object properties? For example, if i had something like this:
How do i get this value with javascript? I've tried to return the value using something like this:
But this returns undefined.. any ideas?
<div id="layer1" property1="hi"> </div>
How do i get this value with javascript? I've tried to return the value using something like this:
document.getElementById('layer1').property1
But this returns undefined.. any ideas?
Felix Lockhart 29 Jan 2008
Is that even possible? I can't find any relevant information in DOM references. What are you trying to do with this?
Liliana 29 Jan 2008
The problem has already been resolved.
[18:37:54] <@Bob> anyhoo... http://forum.cncreneclips.com/index.php?showtopic=21064 [18:39:22] <+Guest63h> Bob: I have the solution in my Turkmen script [18:39:26] <+Guest63h> one moment... [18:40:30] <+Guest63h> or no [18:40:31] <+Guest63h> I don't [18:40:37] <@Bob> D: [18:41:49] <+Guest63h> but [18:41:53] <+Guest63h> it's possible [18:42:34] <+Guest63h> getAttribute returns the value of a given attribute [18:43:06] <+Guest63h> so you want [18:43:32] <+Guest63h> document.getElementById('layer1').getAttribute('property1') [18:44:06] <@Bob> yeah, that works.. thanks :D [18:44:12] <@Bob> brb