I have the following variable:
var tags = [{name:'Bold', key:'b'}, { name: 'Italic', key:'i'}]
Then, in order to get the correct tag I am working on I built a function:
function getCurrentTag(tagType) {
$.each(tags, function() {
if (tagType==this.name) {
return this;
}
});
}
And in the main scope I call it:
currentTag = getCurrentTag('Bold');
But currentTag is always "undefined".
How can I fix this?
Gidi