as the last child of the currently selected element. See :ref:`Inserting new nodes
`.
* - Duplicate Node
- Create a copy of this element, and insert the copy immediately after this element.
* - Delete Node
- Delete the element from the DOM.
* - Attribute/Add Attribute
- Add an attribute to the element.
* - Attribute/Edit Attribute
- (only when invoked on an attribute) Edit the attribute.
* - Attribute/Remove Attribute
- (only when invoked on an attribute) Remove the attribute.
* - Open Link in New Tab
- (only when invoked over a link, such as an href attribute) Opens the linked item in a new tab.
* - Open File in Debugger
- (only when invoked over a link to a JS source) Opens the linked source in the Debugger.
* - Open File in Style-Editor
- (only when invoked over a link to a CSS source) Opens the linked source in the Style Editor.
* - Copy Link Address
- (only when invoked over a URL) Copy the URL.
* - (Change Pseudo-class) hover
- Set the `:hover `_ CSS pseudo-class.
* - (Change Pseudo-class) active
- Set the `:active `_ CSS pseudo-class.
* - (Change Pseudo-class) focus
- Set the `:focus `_ CSS pseudo-class.
* - (Change Pseudo-class) focus-visible
- Set the `:focus-visible `_ CSS pseudo-class.
* - (Change Pseudo-class) focus-within
- Set the `:focus-within `_ CSS pseudo-class.
* - (Change Pseudo-class) visited
- Set the :visited CSS pseudo-class.
.. _page-inspector-how-to-examine-and-edit-html-editing_html:
Editing HTML
************
You can edit the HTML — tags, attributes, and content — directly in the HTML pane: double-click the text you want to edit, change it, and press Enter to see the changes reflected immediately.
To edit an element's `outerHTML `_, activate the element's popup menu and select "Edit As HTML". You'll see a text box in the HTML pane:
.. image:: edit_html.png
:alt: Edit HTML directly in the Inspector panel in Firefox 57
:class: border
You can add any HTML in here: changing the element's tag, changing existing elements, or adding new ones. Once you click outside the box, the changes are applied to the page.
When you're editing HTML, the context menu you'll see is the normal one for working with editable text:
.. image:: editable-context-menu.png
:class: center
Copy and paste
--------------
You can use the :ref:`popup menu ` to copy nodes in the HTML tree and paste them into the desired location.
Drag and drop
-------------
You can reorganize the HTML content of a page by moving nodes in the HTML tree. Just click and hold on any element and drag it up or down in the tree. When you release the mouse button, the element will be inserted at the corresponding position:
.. raw:: html
You can cancel the drag and drop by pressing the :kbd:`Esc` key.
.. _page-inspector-how-to-examine-and-edit-html-inserting-new-nodes:
Inserting new nodes
-------------------
There's a "+" icon at the top of the markup view:
.. image:: html_tree.png
:class: border
Click this icon to insert an empty {{HTMLElement("div")}} into the document as the last child of the currently selected element. You can then edit the new node's content and styling just as you would any other node in the document.
.. raw:: html
You can access the same functionality using the "Create New Node" popup menu item.
Note that this button is disabled if the selected element's type is such that adding a last-child would have no effect (for example, if it is an `html `_ or `iframe `_ element). However, it is enabled in places where it is not valid to insert a `div `_, such as `style `_ or `link `_. In these cases the element is added as text.