bit101/quicksettings

All quicksettings elements has id = null

linux-man opened this issue · 2 comments

Maybe not important, but why? It doesn't look right.
If an id could be given it would be possible to directly manipulate an element. That's a request I'd like to make.
qs.getElement("name") as a function that returns the element would be another option.

  1. There is no HTML requirement for every element to have an id.

  2. There is a requirement that all ids should be unique. This would require a system to generate unique ids for every element created. And as a user, you would not know what those ids were anyway.

  3. If you need to change styles on a control, you can use the overrideStyle method.

  4. If you want to manipulate the controls in some other way, it really just opens up a way to break tthe whole system. If you start moving stuff around, the code could break.

  5. There are other ways of locating elements other than ids. If you really need to do that, JavaScripts query selector methods or even jQuery should be able to help you select any element.

Currently, all elements do have an ID, and the ID is the string "null". So breaking requirement 2 in your list.

It doesn't break anything of course, but seems like it would be better just not to add the attribute.