I have the following inside of a larger function
var margin = $(document).ready(function(){
marginReturn = $('.indbx'+n).css("margin")
return marginReturn
})
and it is unable to grab my margin value. I have obviously tried many methods including plain
var margin = $('.indbx' + n).css('margin')
console.log(margin)
I've been able to get the value in a separate function but why create a new function just to grab a css property? the furthest I've gotten is my first example returning a [document] value
the below DOES return the value when called within a document.ready() function. even though all of my other attempts have been called from a document ready function.
function bxMargin(){
var marginR = $('.indbx'+n).css("margin")
return marginR
}
what am I doing wrong?