html
html copied to clipboard
getElementById does not support ids with point like "my.id"
As getElementById(id) is defined by :
Element getElementById(String id) => querySelector('#$id');
It doesn't work with ids like my.id because it is handled as finding an element with id my and class id.
A workaround is:
//var elmt = getElementById('my.id);
var elmt = querySelectorAll('[id]').firstWhere((e)=> e.id == 'my.id');