Prince Ashitaka
Prince Ashitaka

Reputation: 8763

Sort HTML attributes based on Alphabetical order

Is there a tool for sorting HTML attributes inside elements in Alphabetical order?

Similar to https://xmlsorter.codeplex.com/ for sorting xml files.

Upvotes: 2

Views: 2267

Answers (2)

Daniel
Daniel

Reputation: 4745

HTML Tidy’s --sort-attributes option will sort attributes alphanumerically.

Upvotes: 1

ketan
ketan

Reputation: 19341

Use http://prettydiff.com/?m=beautify&l=html for your HTML code.
It will beautify your HTML code. it will sort your HTML attributes.

Before: enter image description here

After:

enter image description here

Upvotes: 3

Related Questions