The button was created in app.component.html
with gray background color:
<jqxButton
#myButton
style="background-color: gray"
class="myButtonClass"
(onClick)='onClick()'>
Click Button</jqxButton>
When button is clicked I want to change its background color to red in app.component.ts
in the onClick()
method:
export class MyButtonComponent {
@ViewChild('myButton', { static: false }) myButton: ElementRef;
onClick() {
console.log("myButton: Here I want to change any style attribute of the", this.myButton);
}
How to change any style attributes of any jqxwidget
?