Jump to content


[JS / HTML] Using extra object properties


2 replies to this topic

#1 Slightly Wonky Robob

    Not a Wonky Gent.

  • Administrator
  • 9333 posts

Posted 28 January 2008 - 17:37

How do you define / use extra object properties? For example, if i had something like this:

<div id=&#34;layer1&#34; property1=&#34;hi&#34;> </div>

How do i get this value with javascript? I've tried to return the value using something like this:

document.getElementById&#40;&#39;layer1&#39;&#41;.property1

But this returns undefined.. any ideas?
Posted Image
F O R T H E N S
Posted Image

#2 Felix Lockhart

    Visitor

  • Member
  • 22 posts

Posted 29 January 2008 - 20:14

Is that even possible? I can't find any relevant information in DOM references. What are you trying to do with this?

#3 Liliana

    natural power

  • Member
  • 645 posts

Posted 29 January 2008 - 21:13

The problem has already been resolved.

&#91;18&#58;37&#58;54&#93; <@Bob> anyhoo... http&#58;//forum.cncreneclips.com/index.php?showtopic=21064
&#91;18&#58;39&#58;22&#93; <+Guest63h> Bob&#58; I have the solution in my Turkmen script
&#91;18&#58;39&#58;26&#93; <+Guest63h> one moment...
&#91;18&#58;40&#58;30&#93; <+Guest63h> or no
&#91;18&#58;40&#58;31&#93; <+Guest63h> I don&#39;t
&#91;18&#58;40&#58;37&#93; <@Bob> D&#58;
&#91;18&#58;41&#58;49&#93; <+Guest63h> but
&#91;18&#58;41&#58;53&#93; <+Guest63h> it&#39;s possible
&#91;18&#58;42&#58;34&#93; <+Guest63h> getAttribute returns the value of a given attribute
&#91;18&#58;43&#58;06&#93; <+Guest63h> so you want
&#91;18&#58;43&#58;32&#93; <+Guest63h> document.getElementById&#40;&#39;layer1&#39;&#41;.getAttribute&#40;&#39;property1&#39;&#41;
&#91;18&#58;44&#58;06&#93; <@Bob> yeah, that works.. thanks &#58;D
&#91;18&#58;44&#58;12&#93; <@Bob> brb

Quote

Anyway,the China's army is a modernize army,this army can bear down all country's army.
I hope SWR team can modification the China in the RISE OF THE RED and SHOCKWAVE mods.China is a modernize country.Maybe in thirty years later,the China will be a big and powerful country,overrun the US

Quote

[22:23:32] <J8a> why would i read a eula anyway?
[22:23:41] <J8a> they're not written in english
[22:23:59] <J8a> THEY ARE WRITTEN IN, BUT NOT LIMITED TO, CAPITAL LETTERS.



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users