searching by name is probably no worse than searching in classes, but keep in mind that with the selector you specify, it will need to list all the DOM elements to find it. If I were you, I would at least indicate the type that you need:
this.$("div[name=title]")
Also pay attention to the shorthand, which you can use inside the main view; this. $ is a shortcut for $ (this.el) .find, which functionally matches $ (selector, this.el)
EDIT
To answer your further question as to why this would be, there are no functions in the DOM that will return all elements with a specific class name; it’s possible that there is something newer that I don’t know about, but a quick Google search has not changed, if so. You can look at an example implementation here to find DOM nodes with a specific class .
Since this algorithm requires cyclic movement across all elements in the set, there is nothing more expensive than checking the name attribute than checking the class attribute. (note that I didn’t really compare this, but I don’t know the reason to suspect otherwise).
This leads to the fact that I suggested at least indicating the type of the DOM element; if you use a selector such as $ ("[name = title]") then jquery will be forced to list each element in the DOM to find what you are looking for; in this case you are only looking for a small subset of the DOM (children of your representation ), so it’s not so important, but if you specify a type like $ ("div [name = title]"), then it can at least do an optimization using getElementsByTagName, if available.
(I say where available, because I believe that some browsers allow getElementsByTagName to be called on a subset of the DOM nodes, and some only on the document)
source share