Sameer Sheikh Sameer Sheikh - 1 year ago 54
Javascript Question

How can I use jQuery $(this) in react js function

I am working on reactjs and on click I am calling a function.

In that function I want to use jQuery

to change the text of that element.
Is it possible to do so?

Or is there any way with reactjs to change the current elements text?


If you need just change text for element that was clicked you can do it like this

var Component = React.createClass({
    handleClick(e) {
        e.currentTarget.innerHTML = 'New Text';

    render() {
        return <div onClick={this.handleClick}>Change Text</div>;


and using jQuery in our case is not necessary