I am doing the following:
elemDrop: function(elem) {
return elem;
},
elemAddRel: function(json) {
var elem = this.elemDrop;
console.log(elem);
$(elem.item[0]).addClass('showTab').attr('rel', json.pageId);
},
However when i console.log ‘elem’, it just stores the entire function into a variable. How can i actually store the result of the function into the variable?
You should be able to do:
The use of the brackets
()will trigger the function and return the result rather than setting the variable equal to the function itself.