How can I set up code hints for a custom HTML attribute in IntelliJ?

47 Views Asked by At

When I type this is my editor(IntelliJ):

<input type="">

My editor gives me a list of values for the "type" attribute: date, color, button, etc.

Is it possible to create a custom attribute, for which I can provide a set of values, just as the "type" attribute has? For example:

<input flower="rose"> // and other predefined values like "sunflower" of "lavender"

To be clear: I want my editor (like VSCode or IntelliJ) to recognize the "flower" attribute and for me to select a flower from a list.

Edit based on comments: I want this "flower" attribute to not be editor specific, just like "type" is not editor specific. I know about the "data-" attribute option, but as far as I know, you can't have a predefined list of values that the editor recognizes for a "data-.." attribute.

0

There are 0 best solutions below