get value style jquery code example

Example 1: jquery css

$('#element').css('display', 'block'); /* Single style */
$('#element').css({'display': 'block', 'background-color' : '#2ECC40'}); /* Multiple style */

Example 2: jquery set style property

$("selector").css("property", "value");

// Example:
$("div").css("background-color", "red");

Example 3: get css value jquery

var font-size = $('p').css('font-size');
console.log(font-size);

Example 4: jquery val style

<input type="button" style="width:50px" id="wave_id" value="Wave" data-action="button">

Tags:

Css Example