Answer the question
In order to leave comments, you need to log in
How to display div using js?
There is this piece of code:
$.each(g.totals_data.manufacturers, function (f, k) {
if (k.id) {
h[h.length] = k.id;
var j = $("#manufacturer_" + k.id);
if (j.length == 0) {
return;
}
j.removeAttr("disabled");
if (j.get(0).tagName == "OPTION") {
j.text($("#m_" + k.id).val() + "(" + k.t + ")")
} else {
$('label[for="manufacturer_' + k.id + '"]').text($("#m_" + k.id).val() + '(' + k.t + ')')
}
}
});
'(' + k.t + ')'
<div> и </div>
<div>10</div>
Answer the question
In order to leave comments, you need to log in
so replace text with html
$.each(g.totals_data.manufacturers, function (f, k) {
if (k.id) {
h[h.length] = k.id;
var j = $("#manufacturer_" + k.id);
if (j.length == 0) {
return;
}
j.removeAttr("disabled");
if (j.get(0).tagName == "OPTION") {
j.text($("#m_" + k.id).val() + "(" + k.t + ")")
} else {
$('label[for="manufacturer_' + k.id + '"]').html($("#m_" + k.id).val() + '<div>' + k.t + '</div>')
}
}
});
Try wrapping them $()
. Those.
j.text($("#m_" + k.id).val()).append( $( "<div>(" + k.t + ")</div>") );
. Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question