Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing ID value

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello,

I'd like to know how I can access the value of an ID. I tried to use this.id but it doesn't work. I want to use this value as an argument for a Javascript function.

Here is my HTML code:
<DIV ID=&quot;SubjectHeader&quot; STYLE=&quot;visibility:hidden;&quot;>

<script>
subtest(this.ID) ??? how can I put the value of ID ???
</script>

blalbla text description
</DIV>
 
in the exemple below, 'this' is referring to the div, in your example, 'this' referred to the window object:

<DIV ID=&quot;SubjectHeader&quot; STYLE=&quot;visibility:hidden;&quot; onClick=&quot;subtest(this.id)&quot;> jared@aauser.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top