**List of steps to reproduce** (step by step,The Html class has methods messageBox, warningBox and errorBox. including full links if applicable):Currently these support the creation of message boxes in a standardized way.
There are several instances where we create message boxes with ID attributes in our code.
*
*These are:
- #mw-anon-edit-warning shown on the editor for anonymous users and used in McrUndoAction.php. Not used in JavaScript, [[ https://global-search.toolforge.org/?q=mw-anon-edit-warning®ex=1&namespaces=&title= | 42 usages across gadgets/user scripts ]]
* #mw-undelete-revision shown on Special:Undelete. Unused in code, [[ https://global-search.toolforge.org/?q=mw-undelete-revision®ex=1&namespaces=&title= | 13 global search results ]]
* #mw-preferences-success used on Special:Preferences and SpecialLUserrights and Extension:CentralAuth. Unused in code. [[ https://global-search.toolforge.org/?q=mw-preferences-success+®ex=1&namespaces=&title= | 0 results in global search ]].
The question is what should we do about these?
# Options
1) Allow message boxes to define an ID.
This would complicate the Html function API and also encourage bad behaviours such as shipping styles that are usually unused for most page views, changing the default styles for certain message boxes and using the warning to check state e.g. consider this code:
```
*
**What happens?**:
**What should have happened instead?**:
**Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.**:var isAnon = !!document.getElementById( 'mw-anon-edit-warning' );
2) Retain the IDs but move them to container elements
e.g.
```
$out->addHTML(
Html::rawElement(
'div',
[ 'id' => 'mw-anon-edit-warning' ],
Html::warningBox( $html )
)
);
```
3) Drop the IDs.