function getChartById(id){ return $('#'+id).highcharts(); } $(function(){ createChart('container1','Title of Chart #1'); createChart('container2','Title of Chart #2'); $('#selection').change(function(){ alert(getChartById($(this).val()).options.title.text); }); }); function createChart(containerId, title) { var chartingOptions = { title: { text: title }, subtitle: { text: '<a href="http://ahumbleopinion.com/category/highcharts/">Highcharts @ A Humble Opinion</a>', useHTML: true }, credits: { text: "Jugal Thakkar", href: "http://jugal.me/" }, xAxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr'] }, series: [{ name: 'Mumbai', data: [24.2, 24.6, 26.7, 28.6] }] }; $('#' + containerId).highcharts(chartingOptions); }