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,594
2711 2개월 전 조회 323
2710 2개월 전 조회 225
2709 2개월 전 조회 392
2708 2개월 전 조회 231
2707 2개월 전 조회 274
2706 2개월 전 조회 273
2705 2개월 전 조회 144
2704 2개월 전 조회 295
2703 2개월 전 조회 268
2702 2개월 전 조회 282
2701 2개월 전 조회 278
2700 2개월 전 조회 224
2699 2개월 전 조회 172
2698 2개월 전 조회 221
2697 2개월 전 조회 191
2696 2개월 전 조회 164
2695 3개월 전 조회 321
2694 3개월 전 조회 160
2693 3개월 전 조회 214
2692 3개월 전 조회 219
2691 3개월 전 조회 364
2690 3개월 전 조회 269
2689 3개월 전 조회 290
2688 3개월 전 조회 239
2687 3개월 전 조회 451
2686 3개월 전 조회 503
2685 3개월 전 조회 635
2684 3개월 전 조회 371
2683 3개월 전 조회 513
2682 3개월 전 조회 325
🐛 버그신고