'Is there any shortcut/hotkey in vscode to format attributes of an html element

I have this code of element, and i need to format the attributes from this:

<input class="cool-input" id="input" value="test" placeholder="test" />

to

<input class="cool-input"
  id="input"
  value="test"
  placeholder="test"
/>

but I didn't find any hotkey to do it. Is there any, and if there is, what is it?



Solution 1:[1]

Check this thread Stackoverflow thread

Installing an VSCode extension can help too. Here's one Prettier – Code formatter

Can be set up to format on save and Format on selection. The Doc has a very detailed how to guide.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 j08691