document.querySelector bug All In One
<div id="565173" style=" 180px; height: 30px; z-index: 100;">
<div style="text-align: left; padding: 4px;">
<span style="
font-size: 16px;
color: #000000;
letter-spacing: 0rem;
line-height: 1;
">请添加文本内容</span>
</div>
</div>
document.querySelector id bug
document.querySelector('#565173');
// Uncaught DOMException: Failed to execute 'querySelector' on 'Document': '#565173' is not a valid selector.
document.querySelector(565173);
// Uncaught DOMException: Failed to execute 'querySelector' on 'Document': '565173' is not a valid selector.
document.getElementById(565173);
// <div id="565173" style=" 180px; height: 30px; z-index: 100;">…</div>
document.getElementById('565173');
// <div id="565173" style=" 180px; height: 30px; z-index: 100;">…</div>
refs
©xgqfrms 2012-2020
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 ️,侵权必究⚠️!