I have the following iframe
<iframe frameborder="0" src="//www.youtube.com/embed/adLvq2haaFg" class="note-video-clip"></iframe>
When I target iframe through getElementsByTagName like this
let a = document.getElementsByTagName("iframe")[0];
a.setAttribute('allowfullscreen', '');
It returns:
<iframe frameborder="0" src="//www.youtube.com/embed/adLvq2haaFg" class="note-video-clip" allowfullscreen=""></iframe>
It's creating a problem for me because it is not working as expected. When I manually insert allowfullscreen at beginning it's working well.
This is the result I want instead
<iframe allowfullscreen="" frameborder="0" src="//www.youtube.com/embed/adLvq2haaFg" class="note-video-clip" ></iframe>
What am I doing wrong?