appendChild to the top of a list

i’m wanting to add a new <li> to an existing <ul>, but i want it to appear at the top of the list - not append to the bottom.

i’m assuming there’s a semi easy way to do this?

var ul = document.getElementById('my-list');
var li = document.createElement('li');

that’s currently how appending works, i just want to add it at the top.

use insertBefore ie

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="">
        <title>Untitled Document</title>
        <link rel="stylesheet" type="text/css" media="screen" />
        <style type="text/css"></style>
        <script type="text/javascript">
            function add(what, where) {
                var d = document.getElementById('test');
                var li = document.createElement('LI');
                d.insertBefore(li, d.childNodes[where]);
        <ul id="test">

        <br /><a href="javascript:add('10',0);">Add 10 at 0</a>