Q:

using same kind of javascript in more than 1 divs

I am creating cube animations using javascript which is working fine but when i create another div with the same id of javascript then second div is not using dat same script. How do i do that? so i can use same scripts in more than one divs?
Code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>jQuery Image Cube</title>
<style type="text/css">
#basicCube { width: 150px; height: 150px;}
#basicCube img{border:3px solid #ccc}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="jquery.imagecube.js"></script>
<script type="text/javascript">
$(function () {
    $('#basicCube').imagecube();
});
</script>
</head>
<body>
<div id="basicCube">
    <img src="1.jpg" alt="Gorge" title="Gorge">
    <img src="2.jpg" alt="Gorge" title="Gorge">
    <img src="3.jpg" alt="Gorge" title="Gorge">
    <img src="4.jpg" alt="Gorge" title="Gorge">
    <img src="5.jpg" alt="Gorge" title="Gorge">
    <img src="6.jpg" alt="Gorge" title="Gorge">
</div>
</body>
</html>

A:

You shouldn't use an identifier more than once in a document. In this case you will want to use classes instead:
CSS
.basicCube { width: 150px; height: 150px;}
.basicCube img{border:3px solid #ccc}

HTML
<div class="basicCube">
    <img src="1.jpg" alt="Gorge" title="Gorge">
    <img src="2.jpg" alt="Gorge" title="Gorge">
    <img src="3.jpg" alt="Gorge" title="Gorge">
    <img src="4.jpg" alt="Gorge" title="Gorge">
    <img src="5.jpg" alt="Gorge" title="Gorge">
    <img src="6.jpg" alt="Gorge" title="Gorge">
</div>
<div class="basicCube">
    <img src="1.jpg" alt="Gorge" title="Gorge">
    <img src="2.jpg" alt="Gorge" title="Gorge">
    <img src="3.jpg" alt="Gorge" title="Gorge">
    <img src="4.jpg" alt="Gorge" title="Gorge">
    <img src="5.jpg" alt="Gorge" title="Gorge">
    <img src="6.jpg" alt="Gorge" title="Gorge">
</div>

JavaScript
$(function () {
    $('.basicCube').imagecube();
});

