diff --git a/src/getID.js b/src/getID.js index c4c6ab1..6849cff 100644 --- a/src/getID.js +++ b/src/getID.js @@ -5,5 +5,11 @@ */ export function getID( el ) { - return `#${el.getAttribute( 'id' )}`; + const id = el.getAttribute( 'id' ); + + if( id !== null ) + { + return `#${id}`; + } + return null; }