# Syntax Marko's syntax is based on HTML, so you basically already know it. Marko extends the HTML language to add a few nice features which we'll cover here. > **ProTip:** Marko also supports a [beautiful concise syntax](./extras/concise.md). If you'd prefer to see our documentation using this syntax, just click the `switch syntax` button in the corner of any Marko code sample. ## Text replacement When you render a Marko template, you pass input data that is then available within the template as `input`. You can then use `${}` to insert a value into the template: ```xml
\${input}
` syntax.
A line that starts with a `$` followed by a space will execute the code that follows.
```xml
$ var name = input.name;
Hello, ${name}
$ console.log('The value rendered was', name);
```
A statement may continue onto subsequent lines if new lines are bounded by `{}`, `[]`, `()`, ``` `` ```, or `/**/`:
```xml
$ var person = {
name: 'Frank',
age: 32
};
```
Multiple statements or an unbounded statement may be used by wrapping the statement(s) in a block:
```xml
$ {
var bgColor = getRandomColor();
var textColor = isLight(bgColor)
? 'black'
: 'white';
}
```
### Static JavaScript
> **Static:** The JavaScript code that follows `static` will run once when the template is loaded and be shared by all calls to render. It must be declared at the top level and does not have access to values passed in at render.
Inline JavaScript will run each time your template is rendered, if you only want to initialize some values once, use the `static` keyword:
```xml
static var count = 0;
static var formatter = new Formatter();
static function sum(a, b) {
return a + b;
};
${formatter.format(sum(2, 3))}
```
Like inline Javascript, multiple statements or an unbounded statement may be used by wrapping the statement(s) in a block:
```xml
static {
var base = 2;
function sum(a, b) {
return base + a + b;
};
}
```
### Escaping dollar signs
If you need to output a `$` at the beginning of a line, you can escape it: `\$`.
```xml
You can run JS in a Marko template like this:
\$ var num = 123;
```