HTMLSubtitles constructor arguments validation fixed

This commit is contained in:
NikolaBorislavovHristov 2019-02-22 13:39:13 +02:00
parent fab2c1fff6
commit e1bb1b41e5

View file

@ -11,7 +11,7 @@ var FONT_SIZE = Object.freeze({
});
function HTMLSubtitles(containerElement) {
if (!(containerElement instanceof HTMLElement) || typeof containerElement.id !== 'string') {
if (!(containerElement instanceof HTMLElement) || !containerElement.hasAttribute('id')) {
throw new Error('Instance of HTMLElement with id attribute required as a first argument');
}