I have a function that uses a cached element(el) to change the font size of 2 divs. When the function executes I need to make sure the font is not too small or too large based on which div it is(tagCommon or tagLatin). So how can I determine in the function which element was passed to it via el?
I think I may be over thinking this or doing it wrong, it kinda feels like I am hacking it in…and usually when it feels like that there is something wrong.
var cb = $('#tagCommon');
var lb = $('#tagLatin');
changeFontSize(cb,1,'up');
function changeFontSize(el,amount,UporDown){
var size = parseFloat($(el).css("font-size").replace(/px/, ""));
// do some stuff here
// ????????
if(el == $('#tagCommon')) //check font size and alert if too small
if(el == $('#tagLatin')) //check font size and alert if too small
}
Thank you for your time.
Todd
.attr('id')will retrieve the id and match with supplied one.is()matched set of elements against a selector, element, or jQuery object. Return value boolean true/false.