Answers for "js onclick change css'"

4

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>
Posted by: Guest on October-28-2021

Browse Popular Code Answers by Language