title: How to change the style of an element in React?
body: <p>I'm very new to Reactjs, and I have an <code>td</code> in my <code>render</code> method:</p>
  <pre><code>&lt;td style={{cursor: 'pointer'}} onClick={} key={i}&gt;
  </code></pre>
  <p>On click of this <code>td</code>, I want to change its style, how one should do this in react js?</p>
  <p>Thanks.</p>
  <h2>Edited:</h2>
  <p>This is how I have generated by <code>td</code>:</p>
  <pre><code>{this.props.posts.map((service, i) =&gt;
       &lt;tr&gt;
          &lt;td style={{cursor: 'pointer'}} key={i}&gt;
             &lt;span&gt; {posts.createdBy} &lt;/span&gt;
          &lt;/td&gt;
       &lt;/tr&gt;
  )}
  </code></pre>