Kindly help me how to check if element has specific css property (display == none), I tried work around provided on following old questions (questions/2685724 & questions/11306736) but to no avail.
I can't use hasclass as property is being added on media query.
TEST 1
$("a#navicon").click(function () {
var obj = $(this).siblings("ul").attr("id");
alert (obj);
if ($('ul#'+obj).prop("style")["display"] !== 'none') {
alert ("Element is visible");
} else {
alert ("Not!");
}
});
TEST 2
$("a#navicon").click(function () {
var obj = $(this).siblings("ul").attr("id");
alert (obj);
if($('ul#'+obj).has(css('display','none')){
alert("Display of the element is none!")
}
else {
alert("Element is visible!")
}
if(obj.attr('style').indexOf('display') !== none) {
alert("Element is visible!")
}
});
TEST 3
$("a#navicon").click(function () {
var obj = $(this).siblings("ul").attr("id");
alert (obj);
if(obj.attr('style').indexOf('display') !== none) {
alert("Element is visible!")
}
else {
alert ("Element is not visible!");
}
});
TEST 4
$("a#navicon").click(function () {
var obj = $(this).siblings("ul").attr("id");
var bglength = ('ul#'+obj).css('display');
alert (obj);
});