Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js onclick change css

<div id="foo">hello world!</div>
<img src="zoom.png" id="image" />
<script>
  $('#image').click(function() {
    $('#foo').css({
        'background-color': 'red',
        'color': 'white',
        'font-size': '44px'
    });
});
  </script>
 
PREVIOUS NEXT
Tagged: #js #onclick #change #css
ADD COMMENT
Topic
Name
7+1 =