---
title: "HTML Comment action for ActionClip"
canonical_url: "https://actionclip.app/actions/html-comment"
document_type: "standalone_action"
official: true
action_count: 1
catalog_schema_version: 1
catalog_revision: "2026-09-04.1"
catalog_published_at: "2026-09-04T10:30:00Z"
---

# HTML Comment action for ActionClip

Wrap selected text in an HTML comment.

## What it does

Wrap selected text in an HTML comment. It runs locally and handles the selected text without contacting a service.

## Action details

| Field | Value |
| --- | --- |
| Category | Developer Tools |
| Action type | JavaScript |
| Default result | Replace or copy text |
| Internet | Not required |

## Action and outcome

| Action | Outcome |
| --- | --- |
| **HTML Comment** — Selected text: navigation | <!-- navigation --> |

## How to wrap selected text in an HTML comment with ActionClip

1. Select the text you want to use.
2. Choose **HTML Comment** from ActionClip.
3. Review the result, then replace the selection or copy the new text.

## Requirements

No setup required.

## Privacy

Runs locally in ActionClip’s JavaScript sandbox. Selected text does not leave your Mac.

## Action script

````javascript
function run(selected_text) {
  var match = selected_text.match(/^(\s*)([\s\S]*?)(\s*)$/u);
  return match[1] + "<!-- " + match[2] + " -->" + match[3];
}
````

## Links

- [HTML listing](https://actionclip.app/actions/html-comment)
- [Download action definition](https://actionclip.app/actions/html-comment.actionclip)
- [Browse Developer Tools actions](https://actionclip.app/marketplace#marketplace-developerTools)
- [All Marketplace listings](https://actionclip.app/marketplace)
