I am using backbone and
I have following code in template
>
>
and in render function i have following code
render: function() {
$(this.el).html(this.template(this.model));
var selectedElem='[name='+self.model.leave_request_id+']';
console.log(selectedElem);
console.log($(selectedElem));
//$("a[name='"self.model.leave_request_id+"']" )
$(selectedElem).hide();
return this.el;
}
console.log(selectedElem) prints [name=3257]
and console.log($(selectedElem)) prints
[a#approveLeave.al_ynbtn.apv_app, a#rejectLeave.al_ynbtn.can_app, prevObject: m.fn.init[1], context: document, selector: "[name=3257]", jquery: "1.11.1", constructor: function…]
0: a#approveLeave.al_ynbtn.apv_app
1: a#rejectLeave.al_ynbtn.can_app
context: document
length: 2
prevObject: m.fn.init[1]
selector: "[name=3257]"
proto: Object[0]
i want to hide elements with name=3257? how to do that?
No comments:
Post a Comment