Idea: faking css attribute selectors in Internet Explorer by using IE's special Javascript expression() properties
Example: setting the background of all <input>-tags to yellow, but only if they're of type 'text':
/* standards-compliant; works in Mozilla */
input[type="text"]
{
background-color:yellow;
}
/* alternative for Internet Explorer */
input
{
background-color:expression(
this.type=='text' ? 'yellow' : 'transparent');
}
This is about all I could find about expression(): http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/setexpression.asp
For those interested in conditional comments:
http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp
i very much need this, thanks
background-color:expression( this.type=='text' ? 'red' : (this.type=='submit' ? '#e0e0FF' : (this.type=='password' ? '#e0e0e0' : 'transparent')));
that worked too
This is also a great way to override the broken IE box model, something Dave does over at http://www.stilleye.com/scripts/marginfix/