Q: calling an iframe whilst clicking on one or more checkbox I need to call different iframe once i click on one or more checkbox.
The idea is about getting different charts into one graph.
I tried this into my html file :


function control(){
  var checkedValue = null; 
  var inputElements = document.getElementsByName('check_list[]');
  for(var i=0; inputElements[i]; ++i){
      if(inputElements[i].checked){
           checkedValue = inputElements[i].value;
           break;
                                  }
          return checkedValue;
                                     }
  if checkedValue == 'TotalVoiceTrafficBH2'
  { <iframe src="http://localhost/xampp/www/interactive_php_mysql_charts/chart_trans2.html" width="700" height="500"/> }
  }
        if checkedValue == 'TotalVoiceTrafficBH1'
{ <iframe src="http://localhost/xampp/www/interactive_php_mysql_charts/chart_trans1.html" width="700" height="500"/> }
  }


any help please ?
I need to superpose these iframes whilst my user click on 2 or more checkoboxes !

A: Bellow an example
function checkValue() {
  var checkedValue = null;
  var inputElements = document.getElementsByName('check_list[]');
  for (var i = 0; inputElements[i]; ++i) {
    if (inputElements[i].checked) {
      checkedValue = inputElements[i].value;
      break;
    }
    return checkedValue;
  }
}


var iframe = document.createElement('iframe');


switch(checkValue()) {
    case 'TotalVoiceTrafficBH2':
       iframe.src = 'http://localhost/xampp/www/interactive_php_mysql_charts/chart_trans2.html';
        break;
    case 'TotalVoiceTrafficBH1':
       default:
        iframe.src = 'http://localhost/xampp/www/interactive_php_mysql_charts/chart_trans1.html';
        break;

}
document.body.appendChild(iframe);

