回答編集履歴
1
追記
test
CHANGED
@@ -7,3 +7,23 @@
|
|
7
7
|
↓↓↓
|
8
8
|
+ "<span class='test' style='background-image: url("" + picture + "")'></span>"
|
9
9
|
```
|
10
|
+
|
11
|
+
# 参考
|
12
|
+
```javascript
|
13
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
|
14
|
+
<script>
|
15
|
+
$(function(){
|
16
|
+
var picture = '/file/test-9e549aa21136aa01072caf3aecc7e08db1bf87b2.jpg';
|
17
|
+
var test=123;
|
18
|
+
var inHtml = "<li class='test'>"
|
19
|
+
+ "<a href='/test/test/test.html?id=" + test + "'>"
|
20
|
+
+ "<span class='test' style='background-image: url("" + picture + "")'></span>"
|
21
|
+
+ "<p>" + test + "</p>"
|
22
|
+
+ "</a>"
|
23
|
+
+ "</li>";
|
24
|
+
$('ul.portfolio-type-1.portfolio-type-1').append($(inHtml));
|
25
|
+
});
|
26
|
+
</script>
|
27
|
+
<ul class="portfolio-type-list portfolio-type-1">
|
28
|
+
</ul>
|
29
|
+
```
|