<p>Do you only need the HTML labels in the Control Panel?
I tried it for a short time and found this solution. </p>

<p>Install <code>doublesecretagency/craft-cpjs</code>.</p>

<p>Add this snippet into the editor of the plugin.</p>

<pre><code>var $labelReplaceElements = document.querySelectorAll('#fields th &gt; a, #fieldlayoutform .fld-field &gt; span, .field &gt; .heading &gt; label[id]');
Array.from($labelReplaceElements).forEach($element =&gt; {
    $element.innerHTML = $element.innerText;
});
</code></pre>

<p>You should be careful, that only admins can change fields because this solution brings an XSS risk with it.</p>

<p>The disadvantage is that the labels are first displayed as HTML and only after the JavaScript has been executed are they displayed correctly. </p>

CC BY-SA 4.0
2019-07-14T00:01:40.980Z
Yep, I only need it in the control panel. This is exactly what I was looking for. Thanks!
David Jones
CC BY-SA 4.0
2019-07-13T12:56:43.840Z
2019-07-14T10:08:44.250Z
2019-07-14T10:08:44.250Z
Fred
<p>I'm creating field names for electrical components and I'd like to use subscripts like this:</p>

<pre><code>V&lt;sub&gt;min&lt;/sub&gt;
V&lt;sub&gt;max&lt;/sub&gt;
V&lt;sub&gt;adj&lt;/sub&gt;
</code></pre>

<p>V<sub>min</sub>
V<sub>max</sub>
V<sub>adj</sub></p>

<p>Note that this is just for the field name, not the handle. Is there a way to do this in Craft, or a plugin that provides this functionality?</p>

<p>Notes:</p>

<ul>
<li>Unfortunately, Unicode characters won't work in this case because the latin characters I need are not all available as subscripts in Unicode.</li>
<li>I've tried the Relabel plugin without success.</li>
</ul>

CC BY-SA 4.0
2019-07-13T04:06:54.823Z
I don't think it's possible to use HTML (or Markdown) in the field name.
Lindsey D
<field>
Using basic markup in field names
# Using basic markup in field names

(Asked by: username_0 on 2019-07-12)

I'm creating field names for electrical components and I'd like to use subscripts like this:
Vmin
Vmax
Vadj

Vmin
Vmax
Vadj
Note that this is just for the field name, not the handle. Is there a way to do this in Craft, or a plugin that provides this functionality?
Notes:

Unfortunately, Unicode characters won't work in this case because the latin characters I need are not all available as subscripts in Unicode.
I've tried the Relabel plugin without success.

**Tags:** field

> **Comments:**
> **username_1**: I don't think it's possible to use HTML (or Markdown) in the field name.  

---

## 1 answers

### Answer by username_2 on 2019-07-13. Score: 2 | Accepted answer

Do you only need the HTML labels in the Control Panel?
I tried it for a short time and found this solution. 
Install doublesecretagency/craft-cpjs.
Add this snippet into the editor of the plugin.
var $labelReplaceElements = document.querySelectorAll('#fields th > a, #fieldlayoutform .fld-field > span, .field > .heading > label[id]');
Array.from($labelReplaceElements).forEach($element => {
    $element.innerHTML = $element.innerText;
});

You should be careful, that only admins can change fields because this solution brings an XSS risk with it.
The disadvantage is that the labels are first displayed as HTML and only after the JavaScript has been executed are they displayed correctly.

> **Comments:**
> **username_0**: Yep, I only need it in the control panel. This is exactly what I was looking for. Thanks!  

---

