<html>
<head>
<title>访问HTML标签的属性</title>
<script language="JavaScript">
function setAlign(strAlign){
myP.align = strAlign;
}
function getAlign(){
alert(document.all.tags("P").item(0).align);
}
function switchAlign(){
var objEle = document.all.tags("P");
if (objEle(1).getAttribute("align")=="left")
objEle(1).setAttribute("align", "center");
else
objEle(1).setAttribute("align", "left");
}
</script>
</head>
<body >
</form>
</body>
</html>