简体   繁体   中英

javascript - document.form.textbox.style…can't seem to find this?

Can anyone help point me in the right direction - I have the following in a function:

document.form1.textbox1.style.display = 'none';

which works fine.

But I'm trying to find a list of all the possible 'elements'(?) that could come after style, eg '.display=', '.length=' etc, but I don't know the proper name/terms so the searches i'm doing are not returning what I want.

Any ideas? Thanks in advance! :)

leddy

See the CSS spec . Convert hyphenated-names to camelCase (eg backgroundColor not background-color).

Also see the DOM spec .

That said, in most cases it is usually better to modify the element.className (and have a pre–written, external style sheet) instead of modifying the element.style.*

Are you looking for this ?

It also shows browser compatibility.

Style basically maps onto the CSS. As such, display is a CSS property - this is what your setting.

Take a look at CSS and you should understand what you can and cannot set.

Hope this helps!

Ben

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