Hey I'm trying to add <a> tag inside <li> with jquery and I'm struggling to find the right way. here is my code example :
$dropdown.find('ul').append($('<li></li>').append($('<a></a>'))
.attr('href', $option.val())
.attr('data-display', (display || null))
.addClass('option ' + customClassEtay +
($option.is(':selected') ? ' selected' : '') +
($option.is(':disabled') ? ' disabled' : ''))
.html($option.text())
Aucun commentaire:
Enregistrer un commentaire