Is it possible in a html select
, to display the value of the option instead of the text?
It\'s gonna be used for displaying a long disription in the dro
This is the solution.
$("select option").each(function () {
$(this).attr("data-label", $(this).text());
});
$("select").on("focus", function () {
$(this).find("option").each(function () {
$(this).text($(this).attr("data-label"));
});
}).on("change mouseleave", function () {
$(this).focus();
$(this).find("option:selected").text($(this).val());
$(this).blur();
}).change();