Мне нужно это внутри расширения firefox, поэтому я не использую JQuery, вот мой код:
var label = document.createElementNS(XUL_NS, "label"); // create a new XUL label
label.setAttribute("value", actionLabel);
label.setAttribute("class", "label-title");
var description = document.createElementNS(XUL_NS, "description");
description.setAttribute("id", actionId);
description.appendChild(label);
description.innerHTML=actionText;
Выход должен быть:
<description id=actionId> <label class="label-title" value=actionLabel/> This is a long section of text that will word wrap when displayed. </description>
Это сделало работу:
description.insertBefore (этикетка, description.firstChild);