language

Code Language

Programming or scripting language in which this code is written, e.g. “javascript”, for code written in “Javascript 3.0”. (The “3.0” is recorded in the @language-version attribute.)

Used on Element: <code>

ValueMeaning
Text, numbers, or special charactersThe lower case name of the programming or scripting language.
Restriction@language is an optional attribute; there is no default.

Example 1

...
<code   
  code-type="user interface control" 
  language="C++"
  language-version="11"
  xml:space="preserve" 
  orientation="portrait"
  position="anchor">
#include &lt;conio.h>
#include&lt;win_mous.cpp>
// Needed for mouse &amp; win functions#define
...
</code>
...

Example 2

 
...
<code language="javascript">function myFunction() {
    var x, text;
    x = document.getElementById("numb").value;
    if (isNaN(x) || x &lt; 1 || x &gt; 10) {
        text = "Input not valid";
    } else {
        text = "Input OK";
    }
    document.getElementById("demo").innerHTML = text;
}</code>
...