2017-12-05 5 views
0

포커스 변경 이벤트에서 스팬 요소 아리아 숨김 값을 "true"로 변경해야합니다. 어떻게해야합니까? 여기 초점 변경을 아리아 숨겨진 속성에 추가하는 방법은 무엇입니까?

<span id ="jawshide" > #someText </span> 

declaration- 내 스팬 요소이며 여기에이 속성을 추가 할 수있는 올바른 방법이어야한다 무엇 파트 -

document.getElementById('jawshide').innerHTML= " aria-hidden='true' "; 

자바 스크립트는?

답변

2

당신은 jQuery를 setAttribute

document.getElementById('jawshide').setAttribute('aria-hidden', 'true'); 
1

사용하여이 작업을 수행 할 수 있습니다

('#jawshide').attr('aria-hidden', 'true'); 
1

JS : element.setAttribute ("아리아 숨겨진", "진정한")

JQuery와 : Element.attr ("aria-hidden", "true")

관련 문제