有人可以建议如何通过result:<div id="result"></div>
(结果返回所选文件夹的名称” 我想将此名称传递给Django后端。
<form id = "form" enctype="multipart/form" method="post">
<ul id = "selectable">
{% for folder in folders %}
{% csrf_token %}
<li>{{folder}}</li>
{% endfor %}enter code here
</ul>
</form>
result:<div id="result"></div> # This show which folder is selected
<script type="text/javascript">
$(document).ready(function () {
$('#selectable').selectable({
stop: function () {
var result = '';
$('.ui-selected').each(function () {
result += $(this).text() + '<br/>';
});
$('#result').html(result);
});
});
</script>