react function exec when button is clicked
import React, { Component } from 'react';
class App extends Component {
constructor(props) {
super(props);
this.sayHello = this.sayHello.bind(this);
}
sayHello() {
alert('Hello!');
}
return (
<button onClick={this.sayHello}>
Click me!
</button>
);
}
export default App;
Also in JavaScript:
- emit resize event in angular
- javascript convert date from mm/dd/yyyy to yyyymmdd
- error handling in call back function in nodejs
- double click on element using javascript
- angular one way property binding
- how to load localt ext file in js
- es6 array sum javascript
- get a element using name in jquery
- inverser l'ordre des item d'un array js
- index of value in array
- jquery check if screen size
- javascript close window
- js key in dict
- javascript add row to table
- auto refresh page javascript
- scoll a div to bottom in angular
- CChartpie react
- javascript check if a value is an int
- javascript map function
- js test if string
- jquery selector checked
- implement cai webchat in react native
- react proxy error: could not proxy request from localhost:3000 to http localhost:5000 econnreset
- javascript does not equal