<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>


 

相关文章:

  • 2021-06-26
  • 2021-12-25
  • 2021-10-14
  • 2021-12-10
  • 2021-09-09
  • 2021-09-02
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-08
  • 2021-05-24
  • 2021-10-10
  • 2021-07-08
  • 2021-12-27
相关资源
相似解决方案