回答編集履歴
1
chousei
answer
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
<script>
|
3
3
|
const shop={id:123};
|
4
4
|
window.addEventListener('DOMContentLoaded', ()=>{
|
5
|
-
|
5
|
+
document.querySelectorAll('img').forEach(x=>{
|
6
6
|
const src=x.getAttribute('src');
|
7
7
|
if(/\{shop.id\}/.test(src)){
|
8
8
|
x.setAttribute('src',src.replace('{shop.id}',shop.id));
|