Javascript操作元素属性方法总结
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title></title> </head> <body> <!-- 元素属性的操作 第一种:oDiv.style.display="none"; 第二种:oDiv.style["display"]="none"; 第三种:Dom方式 Dom方式操作元素的属性 获取:getAttribute(名称);//99%一般用不着他 设置:setAttribute(名称,值); 删除:removeAttribute(名称); --> </body> </html>