On this page:
Introduction
IntelliJ IDEA automatically completes the names of tags, attributes and their values in files of the following types:
- HTML/XHTML
- XML/XSL
- JSP/JSPX
Automatic tag name completion is based on the DTD or Schema the file is associated with.
If there is no schema association, IntelliJ IDEA will use the file content (tag and attribute names and their values) to complete your input.
In XML/XSL and JSP/JSPX files, completion for taglibs and namespaces is available.
You can have IntelliJ IDEA do one of the following:
- Insert a declaration of the taglib the tag in question belongs to.
- Import the desired taglib and insert all required import and reference statements.
Completing tag names
- Press < and start typing the tag name. IntelliJ IDEA displays the list of tag names appropriate in the current context. Use the ArrowUp and ArrowDown buttons to scroll through the list.
-
Press ⏎ or ⏎⏎ or ⏎⏎ or ⏎Enter, ⏎ or ⏎Enter, ^ M, ⏎, ⌃M, ⏎ or ⌃M to accept selection from the list, or continue typing the tag name manually.
IntelliJ IDEA automatically inserts mandatory attributes according to the schema.
Inserting taglib declaration
- Start typing the tag and press ⌃⌥Space or ⌃⌥Space⌃⌥Space or ⌃⌥Space⌃⌥Space or ⌃⌥Space^ ⌥ Space, ⌃⌥Space or ⌃⌥Space^ ⌥ Space, ⌃⌥Space or ⌃⌥Space.
- From the list of matching tags, select the desired one. The
uriof the taglib it belongs to is displayed in brackets.
-
Select the desired taglib and press ⏎ or ⏎⏎ or ⏎⏎ or ⏎Enter, ⏎ or ⏎Enter, ^ M, ⏎, ⌃M, ⏎ or ⌃M. IntelliJ IDEA adds the declaration of the selected taglib.

Importing a taglib declaration
- Start typing the taglib prefix and press ⌘N, ⌃⏎, ⌘N or ⌃⏎⌃N, ⌃⏎, ⌃N or ⌃⏎⌘N, ⌃⏎, ⌘N or ⌃⏎^ N, ⌥ Insert, ⌃N or ⌃N⌥ Insert.
-
Select the desired taglib from the list of suggestions and press ⏎ or ⏎⏎ or ⏎⏎ or ⏎Enter, ⏎ or ⏎Enter, ^ M, ⏎, ⌃M, ⏎ or ⌃M.

IntelliJ IDEA imports the selected taglib and adds the import statement automatically.