function getValuevar x=documentgetElementByIdmyHeaderalertxinnerHTML x 除了innerHTML方法还有什么别的方法
- x.getAttribute(attributeName): 获取指定属性名的属性值。
- x.setAttribute(attributeName, attributeValue): 设置指定属性名的属性值。
- x.removeAttribute(attributeName): 移除指定属性名的属性。
- x.style.propertyName: 获取或设置指定 CSS 样式属性的值。
- x.classList: 获取元素的类名,可以通过该属性进行添加、删除、切换类名等操作。
原文地址: https://www.cveoy.top/t/topic/fniT 著作权归作者所有。请勿转载和采集!