how to change css of the image link when clicked?

Tags: java,javascript,css,jsf-2,primefaces

Problem :

i have a commandLink that has a graphicImage inside and i want to change some property of the link to show that it is clicked.I could find no built-in property for that purpose. Maybe some javascript or css code is required.Since i am not so good at those,i'd be glad if someone could guide me a way.Thanks

Here is the code of the link.

                    <p:commandLink title="Forward" update="growl"
                        <p:graphicImage value="images/but_forward.png" />

Solution :

Use onclick event of the commandLink to execute javascript. Something like

<p:commandLink onclick="changeCSSInJavascript()" ...> 

    CSS Howto..

    How to have css hover effect affect child elements differently?

    Any Idea how this web site acheives a fluid/liquid layout [closed]

    how to remove the border from the last list item and select :nth-child (multiple items)

    Adding a description to a css image slideshow

    How to center modal window in css+html?

    How to scroll an html element both horizontally and vertically with top and side labels scrolling correctly

    How to fix IE7 float-clear combination

    How to prevent this H2-tag from half disappearing?

    How to create Rectangle With Gradient Color Stripes Border via CSS?

    How to improve page loading which includes css and jquery files

    How to get width of an image after setting the height

    How to create cascading menus in rails?

    Linking CSS button to email - How can it be done?

    How to catch this nth-child() with css

    UI Challenge - how to draw “connectors” between elements?

    how to control div size when other divs are changing [duplicate]

    How to generate CSS using Garden with ClojureScript (lein-garden)

    How to use Bootstrap 3 gradient for background in CSS? [closed]

    How to make the hover attributes stays when it is clicked/active?

    How to move content in ul to the center HTML + CSS

    How can I center three tables in a div?

    How to center my

    text using css?

    How to make only background image transparent in responsive square grid?

    How to show hidden div when javascript is disabled?

    How to animate through stacked images Javascript

    How to change the color of a div in css when another one is on focus

    Bootstrap 4 and user details - how to do the “bootstrap” or correct way?

    How could I achieve the same navigation using CSS3? (currently flash AS3)

    How to apply rounded borders to highlight/selection

    How to change CSS class of a HTML page element using ASP.NET?