You Kuper
You Kuper

Reputation: 1113

Access DIV element from JavaScript

here is the following DIV structure:

<div class="demo">
    <div id="tabs">
        <div id="tabs-1"></div>
        <div id="tabs-2"></div>
</div></div>

How do I access 'tabs-2' from JavaScript?

var plot2 = $.jqplot ('tabs-2', [points], {...

This JavaScript code works fine only for the 1st-level DIV containers, e.g. 'demo'.

Upvotes: 1

Views: 2021

Answers (2)

Basith
Basith

Reputation: 1075

document.getElementById('tabs-2')

Try this..

Upvotes: 0

user1637256
user1637256

Reputation: 41

What about

document.getElementById('tabs-2')

?

Upvotes: 1

Related Questions