Creating DIV Tag

R

Raju.saripalli

Create Javascript object Box and move it

Object Box should create new HTML elements DIV on page.
Quantity of Boxes on the page is unlimited.
DIV should have:
1. absolute position;
2. background color: red;
3. padding 20px;

Do not use document.write, innerHTML, insertAdjacentHTML.

Box(BoxCount, width, height, left, top)
myBox.moveBox(left, top)

BoxCount - text inside of DIV, counting Box number ("Box: " + i)
width, height - size of DIV
left, right - position of DIV on page

All boxes can have the same size, position and move to the same
position.
Important: Size of Boxes on monitor screen should be
the same in Internet Explorer and Mozilla Firefox.

---------------------
Example Javascript:
var myBox = new Box("Count: " + i, 80, 60, 100, 100);
myBox.moveBox(300, 200)

Example HTML:
<body>
<input type='button' value='Add new box' >
<input type='button' value='Move new box' >
</body>
<script>
// your code here
</script>
 
W

webbugtrack

Let me guess, this is your homework?

Most forums will not assist you unless you make an effort to solve it
yourself first.

If you have a specific question, ask away.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,149
Latest member
Vinay Kumar Nevatia0
Top