title: Change Font Color of a Row on click event in Primefaces Datatable
body: <p>I want to change the font color after clicking a particular row in a datatable. I have already used 
  onclick="this.style.color='green'; But it's not persisting. My code is as follows:</p>
  
  <pre><code>&lt;p:dataTable value="#{userOption.menus}" var="mn" id="dt" paginator="true" rows="10"&gt;
   &lt;p:column&gt;
      &lt;h:commandLink action="#{userOption.ret(mn.menuid)}" onclick="this.style.color='green';" update="p1:dt"&gt;
          #{mn.menuname}
      &lt;/h:commandLink&gt;
   &lt;/p:column&gt;
  
  &lt;/p:dataTable&gt;
  </code></pre>