Answers for "jquery add more than one css property"

42

jquery css

$('#element').css('display', 'block'); /* Single style */
$('#element').css({'display': 'block', 'background-color' : '#2ECC40'}); /* Multiple style */
Posted by: Guest on March-04-2020
0

set multiple attributes css javascript

document.getElementById("myElement").style.cssText = "display: block; position: absolute";
Posted by: Guest on August-03-2020
0

add more than 2 css jquery

//by passing the object of css properties will work
$("selector").css({"background-color": "green", "font-size": "14px"});
Posted by: Guest on June-09-2021

Code answers related to "jquery add more than one css property"

Code answers related to "Javascript"

Browse Popular Code Answers by Language