From ProtoScript
Contents |
YUI:SetHtml Behavior
Sets the HTML of a selected element or elements with specified HTML content.
By using the html attribute you can assign an element some HTML. It will replace the current HTML that is inside the element or elements you are targeting.
Example
$proto('#example-1', {
Click: {
onClick: {
SetHtml: {
html: '<p>New Text</p>'
}
}
}
});
Attributes
| Name | Description | Default | Valid Values | Example |
|---|---|---|---|---|
| target | Selected element or elements to place the returned HTML result inside (using innerHTML). | No value. If no value supplied, use the last targeted element. If value is supplied, use the element(s) selected by the target instead. See Element Scope | String value denoting an interface element. See Selecting Elements|FetchHtml: { target: '#mytrips' } - Place result in the element with the ID = 'mytrips' | |
| html | HTML content to use | Any valid HTML | html: ' New Stuff ' |
Callbacks
| Name | Description |
|---|---|
| onSetHtml | Called after SetHtml behavior completes. |
Demo
See SetHtml Demo
