# HTML DOM/Javscript appending

**URL:** <https://forum.kirupa.com/t/html-dom-javscript-appending/240327>\
**Category:** web dev\
**Created:** [October 2, 2007, 4:45am UTC](https://forum.kirupa.com/t/html-dom-javscript-appending/240327 "2007-10-02T04:45:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthewjumps](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@matthewjumps](https://forum.kirupa.com/u/matthewjumps)\
**Post date:** [October 2, 2007, 4:45am UTC](https://forum.kirupa.com/t/html-dom-javscript-appending/240327/1 "2007-10-02T04:45:25Z")

</div>

Im attempting to get my head around the HTML DOM and such, basically what i would like to be able to do is to start with something like

```auto
<img src="images/test.jpg" alt="" class="setBorder1"/>

```

and then use javascript to append some elements around the ![]() element into something like

```auto
<div class="test">
<div class="1"></div>
<div class="2"></div>
<img src="images/test.jpg" alt="" class="setBorder1"/>
</div>

```

how do i go about doing that?
