document.querySelector bug All In One
document.querySelector bug All In One
<div id="565173" style="width: 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="width: 180px; height: 30px; z-index: 100;">…</div>
document.getElementById('565173');
// <div id="565173" style="width: 180px; height: 30px; z-index: 100;">…</div>
refs
©xgqfrms 2012-2020
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/15624606.html
未经授权禁止转载,违者必究!