0

how I can use more than one property in css method in jquery?

$(document).ready(function(e){
        $("#dv1").click(function(){
            $(this).css("height","200px")
            $(this).css("backgroundColor","red")
        })
    })

1 Answers1

2

You can specify all the CSS properties in object form:

$(document).ready(function(e){
    $("#dv1").click(function(){
        $(this).css({
            height: "200px",
            backgroundColor: "red"
        });
    });
});
rink.attendant.6
  • 44,500
  • 61
  • 101
  • 156