How can I store the value of the attribute example style which is inside a div tag which is in the form of property value : 
**<div class="card card-stats" style="background-color:#FF001A">**


1.The above line is the part of HTML code .



2.The below line is the javascript where I am fetching the background color- red which is in hex code .

3. I am confused with the syntax and methods how can we fetch the style attribute value which is having **#FF001A** hex code and store it in a variable using javascript.Later I will compare that value with Red color and my code will execute further.
----------------------------------------------------------------------
 
***UnSure**
//var a=document.getElementsByTagName('div').item(0).getAttributeNode('style');

 // var b=a.getAttributeNode("STYLE").value ;


