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"></scr
ipt>
<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(fun
ction()
{
// In the DIV with the class of list-goes-here, insert the UL inside it.
$(".list-goes-here").appen
d("<ul><li>Ite
m1</li><li>Ite
m 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.