サンプル
順序リスト
<script type="text/javascript">
var $arrA = new Array( "要素1", "要素2", "要素3" );
document.write( '<ol>\n' );
for ( var $counterVar = 0; $counterVar < $arrA.length; $counterVar++ ) {
document.write( '<li>' );
document.write( $arrA[$counterVar] );
document.write( '</li>\n' );
}
document.write( '</ol>' );
</script>
var $arrA = new Array( "要素1", "要素2", "要素3" );
document.write( '<ol>\n' );
for ( var $counterVar = 0; $counterVar < $arrA.length; $counterVar++ ) {
document.write( '<li>' );
document.write( $arrA[$counterVar] );
document.write( '</li>\n' );
}
document.write( '</ol>' );
</script>
↓↓↓出力結果↓↓↓
順不同リスト
<script type="text/javascript">
var $arrB = new Array( "要素1", "要素2", "要素3" );
document.write( '<ul>\n' );
for ( var $counterVar = 0; $counterVar < $arrB.length; $counterVar++ ) {
document.write( '<li>' );
document.write( $arrB[$counterVar] );
document.write( '</li>\n' );
}
document.write( '</ul>' );
</script>
var $arrB = new Array( "要素1", "要素2", "要素3" );
document.write( '<ul>\n' );
for ( var $counterVar = 0; $counterVar < $arrB.length; $counterVar++ ) {
document.write( '<li>' );
document.write( $arrB[$counterVar] );
document.write( '</li>\n' );
}
document.write( '</ul>' );
</script>
↓↓↓出力結果↓↓↓