-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
  • 20,112
  • 21
  • 72
  • 113
khalid jarrah
  • 1,561
  • 5
  • 14
  • 18

3 Answers3

2

I think this should be:

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

HOpe this will work

backtrack
  • 7,996
  • 5
  • 52
  • 99
0

In jQuery solution would be:

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