-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?

4

3 回答 3

2

I think this should be:

$(function() {
              $('.home').click(function() {
                    $(this).css({'background-color', 'red'});
              });
        }):
于 2013-08-01T07:07:55.583 回答
1
$(function() {
              $('.KJX').click(function() {
                    $(this).css({ 'background-color ': 'red'
                                 'font-type' :' oswald'});
              });
        });

HOpe this will work

于 2013-08-01T07:11:13.783 回答
0

In jQuery solution would be:

$('.kjx').click(function(){
   $(this).css({'background-color' : 'red', 'font-type' : 'oswald'});
});
于 2013-08-01T07:08:57.027 回答