how to call javascript method using selectlist on change in vf page code example

Example 1: how to call javascript method using selectlist on change in vf page

var e = document.getElementsByClassName("chartBlock")[0];
    var strUser = e.options[e.selectedIndex].value;
 var visualization = new google.visualization.LineChart(strUser);

Example 2: how to call javascript method using selectlist on change in vf page

var visualization = new google.visualization.LineChart(document.getElementById('chartBlock'));

Example 3: how to call javascript method using selectlist on change in vf page

<apex:selectList size="1" styleclass="chartBlock">
      <apex:selectOptions value="{!dynamiclist}"></apex:selectOptions>
 </apex:selectList>

Example 4: how to call javascript method using selectlist on change in vf page

var e = document.getElementsByClassName("chartBlock")[0];
var strUser = e.options[e.selectedIndex].value;