-1

I have this string here:

<span title=\"\" class=\"ms-crm-Inline-WarningIcon\" style=\"display: none;\"><img class=\"ms-crm-ImageStrip-inlineedit_warning\" id=\"flexi_balloonpercentage_warn\" alt=\"Error\" src=\"/_imgs/imagestrips/transparent_spacer.gif\"><div class=\"ms-crm-Hidden-NoBehavior\" id=\"flexi_balloonpercentage_w\"></div></span>

How do I get the value of 'style'?

Thanks

2 Answers2

0

In jQuery :

var myStyle = $("span").attr("style");
Alteyss
  • 513
  • 3
  • 17
-1

You can use the .css() refer to main jquery site that

http://api.jquery.com/css/jquery site

$( "div" ).click(function() {
   var html = [ "The clicked div has the following styles:" ];

  var styleProps = $( this ).css([
   "width", "height", "color", "background-color"
  ]);
  $.each( styleProps, function( prop, value ) {
  html.push( prop + ": " + value );
   });

     $( "#result" ).html( html.join( "<br>" ) );
     });