Note: ending </script> tags inside the Syntaxhighlighter are altered as "<
//script>
" to display properly.
HTML special characters:
Space
&
<
>
—
&
<
>
cccccc
dedede
dfdfdf
f1f1f1
efefef
document level CSS:
test1
test2
As an imported file within the head tag:
dynamically assigned from ASP.NET code:
JavaScript DOM addressing:
Choose
Ten
Twenty
Thirty
Nothing chosen yet...
Yes
No
Nothing chosen yet...
Fast
Green
Nothing chosen yet...
Control CSS with JavaScript
The general rule is replace the CSS reference with camel case JavaScript. (removing dashes)
Examples:
CSS Property
JavaScript Reference
background-color
backgroundColor
border-color
borderColor
font-family
fontFamily
text-align
textAlign
text-decoration
textDecoration
Usage:
document.ELEMENT_ID.style.JS_PROPERTY="new CSS value";
To add a class to a certain element, we change its className attribute:
To change the HTML within a span tag: (Note: it must contain some initial HTML)
Background color example:
White (FFFFFF)
Red (FF0000)
Blue (0000FF)
Yellow (FFFF00)
Green (00FF00)
Or set the dropdown with with a string:
Hide and Show with CSS: (I usually use .display instead of .visibility because .visibility makes it still occupy space.)
I'm span #1
I'm span #2
I'm span #3
ASP.NET
inline code with page init:
JavaScript Error Trap: