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'.

Answers:

Answer

What about

document.getElementById('tabs-2')

?

Answer
document.getElementById('tabs-2')

Try this..

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.