I don't know why this script worked.
Code:
 
<div id="top" align="center" > bbbbb </div>

<button onclick="aa()">click me</button>

<script type="text/javascript">

function aa () {
var d = document.getElementById("top"); 

var d_align = d.getAttributeNode("align"); 

d.removeAttributeNode(d_align); 
}
</script>