# <cfif>

Used with [<cfelse>](else.md) and [<cfelseif>](elseif.md), [<cfif>](if.md)lets you create simple and compound conditional statements in CFML.

The value in the [<cfif>](if.md) tag can be any expression.

This tag **must** have a body.
This tag is also supported within [<cfscript>](script.md)

```
<cfif #boolean condition#><!--- body ---></cfif>
```

# Attributes

| Attribute | Type | Required | Description | Default |
|-----------|------|----------|-------------|---------|
| condition | boolean | No | condition o the expression |  |

# Examples

### Simple example

### Tag example

```cfml
<cfset numb=12>
<cfif numb gt 1>
<cfoutput>It is greater than 1</cfoutput>
</cfif>
```

### Script example

```cfml
	//script format
	numb=12
	if(numb gt 1){
		writeOutput("It is greater than 1");
	}
```








# Categories

[Core CFML Language](../../categories/core.md)

# See Also

[<cfelse>](else.md), [<cfelseif>](elseif.md)