조회 : 289
#소스
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr" />
<title>Untitled Document</title>
</head>
<body>
<span id="span" title="txt : title">span</span><br />
<script type="text/javascript">
var span = document.getElementById('span');
document.write('1 : '+span.title);
document.write('<br/>');
span.setAttribute('title2','txt : title2_1');
document.write('2 : '+span.title2);
document.write('<br/>');
span.title2 = 'xxxx';
document.write('3 : '+span.title2);
document.write('<br/>');
span.setAttribute('title2','txt : title2_2');
document.write('4 : '+span.title2);
document.write('<br/>');
document.write('5 : '+span.getAttribute('title2'));
document.write('<br/>');
</script>
</body>
</html>
# 결과
## IE
span
1 : txt : title
2 : txt : title2_1
3 : xxxx
4 : txt : title2_2
5 : txt : title2_2
## FF
span
1 : txt : title
2 : undefined
3 : xxxx
4 : xxxx
5 : txt : title2_2
# 결론
IE에서는 obj.setAttribute('title2','xxxx')로 해도 obj.title2 로 한것과 같은 것으로 처리되는 것 같다.
FF에서는 완벽하게 구분한다.
제목 |
---|
[기본형] HTML (with 부트스트랩5.3 , jquery 3.7, vue.js) |
유용한 리눅스(LINUX) 명령어 |
[공지] 기술 게시판 |
일 |
월 |
화 |
수 |
목 |
금 |
토 |
---|---|---|---|---|---|---|
6.29
|
6.30
|
7.1
|
7.2
|
7.3
|
7.5
|
|
7.6
|
7.7
|
7.8
|
7.9
|
7.10
|
7.11
|
7.12
|
7.13
|
7.14
|
7.15
|
7.16
|
7.17
|
7.18
|
7.19
|
7.20
|
7.21
|
7.22
|
7.23
|
7.24
|
7.25
|
7.26
|
7.27
|
7.28
|
7.29
|
7.30
|
7.31
|
8.1
|
8.2
|