How can you execute code only once for each element using jQuery?
Description : Use the .one() method to attach event handlers that execute only once.
Answer :
To execute code only once for each element using jQuery, use the `.one()` method. For example,`$('#elementId').one('click', function() { alert('This will only happen once!'); });` attaches a click event handler to the element withID`elementId` that executes only the first time the element is clicked. After the handler is executed, it is automatically removed. This method is useful for cases where you need an action to occur just once per element.