I have this code
$(".area").on("keyup", function(){ this.style.height = "1px"; var buttons_matrix = (25 + this.scrollHeight) + "px"; var p = $( "#butons_matrix" ).css('top', buttons_matrix); }); How can I make it as soon as the class area is used once don't repeat it again the height, I can't use id here
.one()instead of.on()off()function of jQuery inside of the handler. e.g.$(".area").off("keyup")or$(this).off("keyup")when you need to disable only the element, not all classes.alert()in.one()to detecting your code is correct.