Resolved the issue. There wasn't a problem with the function or with Chrome. The function should be called by a drupal form element. I was adding the onclick event which called the function to the drupal form itself, instead of a particular form element.
Pretty much doing this:
$form['testform'] = array(
'#type' => 'fieldset',
'#collapsible' => TRUE,
'#collapsed' => FALSE,
'#attributes' => array(
'onchange' => 'testfunc()'),
);
Instead of this:
$form['testform']['element1'] = array(
'#type' => 'select',
'#options' => options,
'#required' => false,
'#attributes' => array(
'onchange' => 'testfunc()'),
);
Don't I feel silly.