Uuid Uuid - 4 months ago 67
Javascript Question

Is it possible to display html content inside a jquery chosen plugin option?

Is it possible to add any html element just like

<p><strong>
or any other inside a chosen select option?

var chzn = $('#chzn');
chzn.chosen({width:'125'});

//
chzn
.append($('<option>', {
value: 1,
text : 'title: <strong> description </strong>'
}))


chzn
.val('')
.trigger("chosen:updated")


http://jsfiddle.net/Xs3wQ/

Answer

you can do this:

html : 'title: <strong> description </strong>'
Comments