From 2fc1eb1780a60adb6a5730112385ec735cd22d69 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 27 Jul 2021 12:04:27 -0400 Subject: remove link 'title' attributes that's just the 'href' (ko, part 2) (#1740) --- files/ko/web/api/element/getattribute/index.html | 2 +- files/ko/web/api/element/scrollintoview/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'files/ko/web/api/element') diff --git a/files/ko/web/api/element/getattribute/index.html b/files/ko/web/api/element/getattribute/index.html index c8f3947310..b177406bff 100644 --- a/files/ko/web/api/element/getattribute/index.html +++ b/files/ko/web/api/element/getattribute/index.html @@ -35,7 +35,7 @@ alert(align); // id가 "div1"인 요소(element)의 align 값을 보여줍니다

When called on an HTML element in a DOM flagged as an HTML document, getAttribute() lower-cases its argument before proceeding.

-

Essentially all web browsers (Firefox, Internet Explorer, recent versions of Opera, Safari, Konqueror, and iCab, as a non-exhaustive list) return null when the specified attribute does not exist on the specified element; this is what the current DOM specification draft specifies. The old DOM 3 Core specification, on the other hand, says that the correct return value in this case is actually the empty string, and some DOM implementations implement this behavior. The implementation of getAttribute() in XUL (Gecko) actually follows the DOM 3 Core specification and returns an empty string. Consequently, you should use {{domxref("element.hasAttribute()")}} to check for an attribute's existence prior to calling getAttribute() if it is possible that the requested attribute does not exist on the specified element.

+

Essentially all web browsers (Firefox, Internet Explorer, recent versions of Opera, Safari, Konqueror, and iCab, as a non-exhaustive list) return null when the specified attribute does not exist on the specified element; this is what the current DOM specification draft specifies. The old DOM 3 Core specification, on the other hand, says that the correct return value in this case is actually the empty string, and some DOM implementations implement this behavior. The implementation of getAttribute() in XUL (Gecko) actually follows the DOM 3 Core specification and returns an empty string. Consequently, you should use {{domxref("element.hasAttribute()")}} to check for an attribute's existence prior to calling getAttribute() if it is possible that the requested attribute does not exist on the specified element.

Browser compatibility

diff --git a/files/ko/web/api/element/scrollintoview/index.html b/files/ko/web/api/element/scrollintoview/index.html index 1736aa2e40..8fc2973583 100644 --- a/files/ko/web/api/element/scrollintoview/index.html +++ b/files/ko/web/api/element/scrollintoview/index.html @@ -84,5 +84,5 @@ element.scrollIntoView({behavior: "smooth", block: "end", inline: "nearest"});더보기 -- cgit v1.2.3-54-g00ecf