code Code Elements
short_text
<code>
Inline code snippets
format_align_left
<pre>
Preformatted text blocks
keyboard
<kbd>
Keyboard input
functions
<var>
Variables in math/programming
integration_instructions Code Examples
<p>Use the <code>document.getElementById()</code> method.</p>
<pre>
<code>
function greeting() {
console.log("Hello World");
}
</code>
</pre>
<code>
function greeting() {
console.log("Hello World");
}
</code>
</pre>
<p>Press <kbd>Ctrl</kbd> + <kbd>C</kbd> to copy.</p>
<p>The equation is <var>x</var> = <var>a</var> + <var>b</var>.</p>
lightbulb Usage Guidelines
- check_circle <code> for short inline code references
- check_circle <pre> + <code> for code blocks
- check_circle <samp> for program output samples
- check_circle <kbd> for keyboard input text
- check_circle <var> for variables in equations
assignment Related Exercises
code
Inline Code
format_align_left
Block Code
functions
Equations & Variables
keyboard
Keyboard Shortcuts
output
Sample Output
terminal
Linux Commands