조회 : 413
#소스
<!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) 명령어 |
| [공지] 기술 게시판 |
일 |
월 |
화 |
수 |
목 |
금 |
토 |
|---|---|---|---|---|---|---|
|
5.31
|
6.1
|
6.2
|
6.3
|
6.4
|
6.5
|
6.6
|
|
6.7
|
6.8
|
6.9
|
6.10
|
6.11
|
6.13
|
|
|
6.14
|
6.15
|
6.16
|
6.17
|
6.18
|
6.19
|
6.20
|
|
6.21
|
6.22
|
6.23
|
6.24
|
6.25
|
6.26
|
6.27
|
|
6.28
|
6.29
|
6.30
|
7.1
|
7.2
|
7.3
|
7.4
|