In javascript can I specify the order of attributes of XMLSerializer output. This is my code.
var serializer = new XMLSerializer ();
var str = serializer.serializeToString (document);
When I try to write this 'str' value to Window.document and again serialize it, I get attributes in different orders.
For example:
In first serialize output
<img style="width: 10%" src="../Koala.jpg" />
In second serialize output
<img src="../Koala.jpg" style="width: 10%" />
I want both this outputs to be equal. Since I want to do a string comparison this is an essential requirement. Pls suggest me a way to get this done.. Thank in advance..