getAttribute()//HTML속성을 가져온다
gettAttribute()//HTML속성을 설정한다
removeAttribute()//HTML요소의 속성을 제거
<img id="
myimage" src="http://www.jasko.co.kr/src/0000.gif">
<div id="
mylayer" style="width:200px;height:30px;background-color:yellow">이
레이어의 배경색은 노랑색 입니다</div>
<script>
<!--
function checkSrc() { // myimage 의 src 속성을 리턴합니다
getSrc=document.getElementById("myimage").getAttribute("src")
(getSrc = 폼네임.id.src=" .jpg" 이런식으로 설정해도 된다 , id값은 유일해야함)
alert(getSrc);
}
function setSrc() { // myimage 의 src 속성을 변경합니다
document.getElementById("myimage").setAttribute("src","http://www.jasko.co.kr/src/0001.gif")
}
function reMove() { // mylayer 의 style 을 제거합니다
document.getElementById("mylayer").removeAttribute("style")
}
//-->
</script>