Jump to content

<style type="text/javascript">


Jesdisciple
 Share

Recommended Posts

I have Macromedia Dreamweaver MX 2004, and, when I type "<style type=", it suggests both the standard "text/css" and "text/javascript". Can JavaScript (or any other non-CSS language) style a document and/or go in the STYLE tag? (I know JS can make DOM modifications; I mean in a similar way to CSS.)Thanks!Chris

Link to comment
Share on other sites

Technically speaking, it is valid. That is, the document will validate. The reason is the "type" attribute is allowed to specify any MIME type, so that future languages W3C may decide to make for styling could be embed in today's (X)HTML documents.Practically speaking though, it's not valid, and I don't think it should to be interpreted either. Most browsers though would interpret a style element's contents as CSS regardless of their type though, as the (X)HTML spec allows them to (it says the type SHOULD specify the type of the language used).

Link to comment
Share on other sites

Hm. I figured since CSS and JS were the only options provided for STYLE, while JS and five other types (not CSS) were provided for SCRIPT, perhaps the late Macromedia had some legitimate purpose for suggesting that I style my page with JavaScript. O, well...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...