简体   繁体   中英

Attributes for .setAttribute method

I'm new to javaScript and I'm watching a lynda dot com video on JavaScript Essentials by Simon Allardice. In lesson 22, he goes over how to change DOM elements using JS. In an example, he uses .setAttribute(“ align ”, “ right ”); to change the alignment of some paragraph text to align right witin a div tag.

Does anyone know where I can find a reference list of available attributes to use for other DOM elements? I tried to search "javascript attributes reference list", but it returns html attributes.

HTML element and DOM element are synonymous. In the example you are using javascript to set HTML (DOM) element attributes. Here is a good resource.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM