Question : create OL or UL using DOM

Just need to create a list system via DOM..Not sure how to do it..

Answer : create OL or UL using DOM

The easiest way I know is to use jQuery (http://www.jquery.com)

The jQuery JavaScript would look something like this. This is a very rudimentary example.

// Include the jQurey library inside your head tag
<script src="jquery-1.4.2.min.js" type="text/javascript"></script>

<script type="text/javascript">
// This will run one the DOM is loaded
$(document).ready(function()
{
    // Add a click event to the button with the ID of myButtonId
    $("#myButtonId").click(function()
    {
        // In the DIV with the class of list-goes-here, insert the UL inside it.
        $(".list-goes-here").append("<ul><li>Item1</li><li>Item 2</li></ul>");
    });
});
</script>

// In the markup somewhere

<div class="list-goes-here">
</div>

Maybe something like that would do the trick? I use jQuery in every application. It is powerful, fast, small, and reduces the amount of code you have to write.
Random Solutions  
 
programming4us programming4us