Do you want to add a new div or change the id of the div on button click
if you want to change id of the div, do like this...
<div id="javascript:x">
</div>
<input name="btn" type="button" value="Submit" onclick="setIDs()" />
<script type="text/javascript">
var x = 0;
function setIDs() {
var divs = document.getElementsByTagName('div');
for (var i = 0; i < divs.length; i++) {
divs[i].id = x++;
}
}
</script>
it changes the id of the div on each button click