I am using jquiry and wanted to use an if statement to determine the width of a span and if it's larger than x with add a class to the same object
if ($(".tool-tip").width() > 300) {
$(this).addClass("full-width")
}
I expected "this" to apply a class of full-with to the class of tool-top
Aucun commentaire:
Enregistrer un commentaire