سؤال

According to MDN HTMLSelectElement reference, focus and blur methods are being deprecated since HTML5. Why is this?

هل كانت مفيدة؟

المحلول

The focus and blur methods have been moved to the HTMLElement interface from which the HTMLSelectElement interface derives.

This makes sense, since any element that has a tabindex attribute can gain and lose focus, not just specialised elements as may have been the case when DOM Level 2 HTML was written.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top