lundi 6 août 2018

jQuery if statement to show different charts on click

Apologies if this has been asked before (new to stack and JS). I have a series of buttons - when clicked I need a different chart to generate. Although the module (html/css) appears on click, the charts do not. The charts work in another part of the app, so I am sure that code is good to go and did not add to this post.

html

<a href="#" aria-controls="" data-toggle="pill" 
id='nameType'></a>

js

if ($('#nameType').attr('href') == 'XYZ'){
    var treeData = treeXYZ;
}else{
    var treeData = treeABC;
}

Thanks!

Aucun commentaire:

Enregistrer un commentaire