2026, 새로운 도약을 시작합니다.

웹접근성심사 홈페이지를 위한 대체텍스트 alt 입력 기능

웹접근성 마크가 있는 홈페이지는 이미지에 대체텍스트(alt)를 입력해야 합니다.

장애인분들을 위해 필요한 내용이죠...

smartteditor2 게시판에 첨부한 분을 위해 간단한 소스 공유합니다.

예시 이미지입니다.

3731943363_1760421301.3798.png

/plugin/editor/smarteditor2/SmartEitor2Skin.html

아래 내용 추가하시면 됩니다.

[code]

<!-- SE2 Markup End -->
<script>
(function() {
    function attachImageAltEditor() {
        const iframe = document.getElementById("se2_iframe");
        if (!iframe) {
              return setTimeout(attachImageAltEditor, 500);
        }

        const editorDoc = iframe.contentDocument || iframe.contentWindow.document;
        if (!editorDoc || !editorDoc.body) {
            return setTimeout(attachImageAltEditor, 500);
        }

        // 중복 방지
        if (editorDoc.__altEventAttached) return;
        editorDoc.__altEventAttached = true;

        console.log("SmartEditor2 이미지 ALT 편집기 연결 완료");

        editorDoc.addEventListener("click", function(e) {
            const target = e.target;
            if (target.tagName === "IMG") {
                const currentAlt = target.getAttribute("alt") || "";
                const newAlt = prompt("이미지 대체텍스트(alt)를 입력하세요.", currentAlt);
                if (newAlt !== null) {
                    target.setAttribute("alt", newAlt.trim());
                }
            }
        });
    }

      setTimeout(attachImageAltEditor, 500);
})();
</script>
[/code]

|

댓글 3개

감사 합니다.

편하게 사용할 것 같습니다. 감사합니다. ^^

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

그누보드5 팁자료실

번호 제목 글쓴이 날짜 조회
공지 3년 전 조회 4,596
2741 2일 전 조회 98
2740 4일 전 조회 93
2739 1주 전 조회 205
2738 1주 전 조회 208
2737 1주 전 조회 173
2736 1주 전 조회 275
2735 3주 전 조회 277
2734 3주 전 조회 258
2733 1개월 전 조회 261
2732 1개월 전 조회 298
2731 1개월 전 조회 263
2730 1개월 전 조회 221
2729 1개월 전 조회 349
2728 1개월 전 조회 243
2727 1개월 전 조회 418
2726 1개월 전 조회 251
2725 1개월 전 조회 325
2724 1개월 전 조회 356
2723 1개월 전 조회 264
2722 1개월 전 조회 297
2721 1개월 전 조회 210
2720 2개월 전 조회 303
2719 2개월 전 조회 306
2718 2개월 전 조회 199
2717 2개월 전 조회 334
2716 2개월 전 조회 201
2715 2개월 전 조회 310
2714 2개월 전 조회 270
2713 2개월 전 조회 373
2712 2개월 전 조회 288
🐛 버그신고