Answers for "jquery css multiple line"

CSS
1

jquery css multiple line

/* To avoid writing the same line several times 
   You can use multiple lines in the css function*/

    $('.selector').css({
     'font-size' : '10px',
     'width' : '30px',
     'height' : '10px'
	});

/* Obviously you can store these value in a variable too */

	var style = {
     'font-size' : '10px',
     'width' : '30px',
     'height' : '10px'
	}

    $('.selector').css(style);
Posted by: Guest on July-20-2021

Browse Popular Code Answers by Language