-4

Here is a div:

 <DIV CLASS= "KJX" > 
     // DIV CONTENT
 </DIV>

after clicking on the div, I want to change the div style to this:

   <style> 
       background-color: red;
       font-type: oswald;
   </style>

I want the change to stay on the div after clicking, not just during the clicking. Is there script for that?

Paolo
  • 17,649
  • 21
  • 81
  • 115
khalid jarrah
  • 1,449
  • 3
  • 14
  • 16

3 Answers3

2

I think this should be:

$(function() {
              $('.home').click(function() {
                    $(this).css({'background-color', 'red'});
              });
        }):
MANISHDAN LANGA
  • 2,185
  • 6
  • 28
  • 42
1
$(function() {
              $('.KJX').click(function() {
                    $(this).css({ 'background-color ': 'red'
                                 'font-type' :' oswald'});
              });
        });

HOpe this will work

backtrack
  • 7,822
  • 5
  • 48
  • 98
0

In jQuery solution would be:

$('.kjx').click(function(){
   $(this).css({'background-color' : 'red', 'font-type' : 'oswald'});
});
Gintas K
  • 1,428
  • 3
  • 17
  • 37