显示在其他位置的模板中单击的ID值的数据。
这两个是不同的div,所以我认为它们不会是 http://jsfiddle.net/ambiguous/R23Ak/
此网站中的问题代码区域 https://jsfiddle.net/erg356mh/7/
html
val file = try {
File(context.cacheDir, fileName)
} catch (t: Throwable) {
return null
}
return if (file.exists()) Uri.fromFile(file) else null
js
<div id="adiv">
<script id="mainTemp" type="x-handlebars-template">
{{#data}}
<button id="{{id}}">{{name}}</button>
{{/data}}
</script>
</div>
<br>
<br>
<br>
<script id="subTemp" type="x-handlebars-template">
<div id="bdiv">
I would like to display the color of the button clicked here.<br><br>
Example: <br>
Click area1 to display black.<br>
Click area2 to display blue.<br>
Click area3 to display brown.
</div>
<script>