# Two-Way Binding

Some attribute bindings are observable and provide two-way bindings.  These bindings will update the source data if changes are made in the HTML element to which the data is bound.

The following example uses the observable `wr-value` binding.&#x20;

```javascript
class MyComponent extends wire.ui.WebComponent {

  static get properties() {
    return {
      message: true
    }
  }
  static get template() {
    return '<input wr-value="message">';
  }
      
}a
```

Any changes to `sourceProperty` in `my-component`'s `input` element will immediately be reflected in the `my-page` component.

```javascript
class MyPage extends wire.ui.WebComponent {

  sourceProperty = "Hello web components"; 

  static get template() {
    return '<my-component wr-message="sourceProperty"></my-component>';
  }      
}
customElements.define('my-page', MyPage);
```

```html
<!-- Output -->
<input value="Hello web components">
```

There are other observable attribute bindings are available to use.  For a list and examples of each or to learn how to create your own bindings, visit the [Tinybind bindings page](https://blikblum.github.io/tinybind/docs/guide/#binders-one-way).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wirebootstrap.com/webcomponents/two-way-binding.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
