Is it possible to have some sort of Id scoping when manipulating DOM with JS?
I use jQuery as my JS framework.
For example:
Is there any mechanism that would allow to select someDiv children of first or someDiv children of second, or do all ids on the page have to be unique? I know this would be doable using classes (jQuery selector would be .first>.someDiv), but is this doable for the id property as well? ---------- Edit: for clarification, here's a more complete example: File picture_editor.php: ... JS script for this editor, that needs to manipulate picture_id...
File main_view.php:
...
Script that manipulates picture_id...
include(picture_editor.php);
...
Now in the case where picture_editor is included in a file (like main_view) that has an element with the same id as elements in picture_editor, something somewhere is going to stop working (whether it's some script in picture_editor or main_view, or both). Question: How do you go around that?