Ahhh...one trivial change. In red, below. Same as the example given on the aforementioned link.

Code:

<script>
function line(txt)
{
if(txt==null) txt = "";
document.write( txt + "<br/>\n" );
}
var m1 = [
[1,2,3],
[4,5,6]
] ;
var m2 = [
[7,8],
[9,10],
[11,12]
] ;
var ans = [
[],
[]
];
var height = m1.length;
var width = m1[0].length;
// height/width of 2nd matrix must match width/height of first one:
if ( m2.length != width ) alert("KABLOOEY");
if ( m2[0].length != height ) alert("KABLOOEY")
for ( var m1row = 0; m1row < height; ++m1row )
{
for ( var m2col = 0; m2col < height; ++m2col )
{
var sum = 0;
for ( var m1col = 0; m1col < **width**; ++m1col )
{
line( m1[m1row][m1col] + " X " + m2[m1col][m2col] );
sum += m1[m1row][m1col] * m2[m1col][m2col];
}
ans[m1row][m2col] = sum;
line( "SUM: " + sum);
}
}
line("[");
for ( var arow = 0; arow < ans.length; ++arow )
{
line(" [" + ans[arow].join(",") + "]" );
}
line("]");
</script>