To find the value of a css property of a given element using jQuery
, we can use the function .css () .
//Aqui retorna o valor do background-image
$('#id').css('background-image');
//Enquanto aqui o background-image vai receber o valor 'none'
$('#id').css('background-image', 'none');
Now, if you can not or do not want to use jQuery, there's a way to do it with just Javascript.
var element, style, backgroundimage;
element = document.getElementById('id');
style = window.getComputedStyle(element);
backgroundimage = style.getPropertyValue('background-image');
Source: SOEn: Get a CSS value with JavaScript
@EDIT
I did not realize that you were using WebBrowser
, so try to access the Style
attribute of the element returned by GetElementById
. Example:
var obj = webBrowser.Document.GetElementById("senderscore").Style
Now using this property you can search for background-image
within String
.
Source: MSDN HtmlElement.Style Property