My code below works in firefox perfectly..but not in Safari. When I use the Safari debug it simply says there is a parse error, just after the first opening curly bracket {
function setVals4(class,val)
{
var array = document.getElementsByTagName("select");
for (var g = 0; g < array.length; g++)
{
sel = array[g]
//sel = document.myform.sel[g];
for (i=0; i<sel.options.length; i++)
{
//alert(sel.options[i].value)
if (sel.className == class)
{
if (sel.options[i].value == val)
{
sel.selectedIndex = i;
}
}
}
}
}
Can anyone figure out why? Help!