## ToggleAttribute(*string*) {#toggleattribute}

If force is not given, "toggles" qualifiedName, removing it if it is present and adding it if it is not present. If force is true, adds qualifiedName. If force is false, removes qualifiedName.

```csharp
public bool ToggleAttribute(string qualifiedName)
```

| Parameter | Type | Description |
| --- | --- | --- |
| qualifiedName | String | The attribute QualifiedName. |

### Return Value

Returns true if qualifiedName is now present; otherwise false.

### See Also

* class [Element](../)
* namespace [Aspose.Html.Dom](../../../aspose.html.dom/)
* assembly [Aspose.HTML](../../../)

---

## ToggleAttribute(*string, bool*) {#toggleattribute_1}

If force is not given, "toggles" qualifiedName, removing it if it is present and adding it if it is not present. If force is true, adds qualifiedName. If force is false, removes qualifiedName.

```csharp
public bool ToggleAttribute(string qualifiedName, bool force)
```

| Parameter | Type | Description |
| --- | --- | --- |
| qualifiedName | String | The attribute QualifiedName. |
| force | Boolean | The force option to toggle attribute. |

### Return Value

Returns true if qualifiedName is now present; otherwise false.

### See Also

* class [Element](../)
* namespace [Aspose.Html.Dom](../../../aspose.html.dom/)
* assembly [Aspose.HTML](../../../)
