springboot怎么把数据传给前端:springboot 如何引入前端 bootstrap?
这种问题网上一搜一大堆,你可以具体找一篇文章试试,遇到问题可以针对相关问题去提问。springboot通过jar包方式引入bootstrap_个人文章 - SegmentFault 思否 这不是查查就
顺晟科技
2022-10-19 14:10:36
119
如何在select中选择属性,并显示text[0]数组的文本等等,我需要在此代码中添加此函数而不更改它。
对不起,我以前问过这个问题,但我不能适应,所以我发布了另一个代码
<!DOCTYPE html>
<html>
<script>
var property = new Array();
property[0] = "Acceleration";
property[1] = "Area";
property[2] = "Lenght";
property[3] = "Weigth";
var text = new Array();
text[0] = "Aceleration is the first value of converter";
text[1] = "Area is the second value of converter";
text[2] = "Aceleration is the first value of converter";
text[3] = "Area is the second value of converter";
function FillMenuWithArray(myMenu, myArray) {
var i;
myMenu.length = myArray.length;
for (i = 0; i < myArray.length; i++) {
myMenu.options[i].text = myArray[i];
}
}
window.onload = function(e) {
FillMenuWithArray(document.property_form.the_menu, property)
}
</script>
<body>
<h2>What Can JavaScript Do?</h2>
<form name="property_form">
<span>
<select class="select-property" name="the_menu">
</select>
</span>
</form>
<br>
<br>
<p id="text">Text</p>
</body>
</html>
顺晟科技:
您的代码出现了一些问题,所以我发现最好编写自己的相关版本,供您参考。您可以在这里运行代码段,看看这是否是您正在寻找的代码。
最后,我设法将这两个解决方案结合在一起(感谢您的贡献),以达到这个结果,当选择该选项时,会出现相应的文本,它与前面的代码更相似
<!DOCTYPE html>
<html>
<script>
var property = new Array();
property[0] = "Acceleration";
property[1] = "Area";
property[2] = "Lenght";
property[3] = "Weigth";
var text = new Array();
text[0] = "Aceleration is the first value of converter";
text[1] = "Area is the second value of converter";
text[2] = "Aceleration is the first value of converter";
text[3] = "Area is the second value of converter";
function FillMenuWithArray(myMenu, myArray) {
var i;
myMenu.length = myArray.length;
for (i = 0; i < myArray.length; i++) {
myMenu.options[i].text = myArray[i];
}
}
window.onload = function(e) {
FillMenuWithArray(document.property_form.the_menu, property)
}
</script>
<body>
<h2>What Can JavaScript Do?</h2>
<form name="property_form">
<span>
<select class="select-property" name="the_menu">
</select>
</span>
</form>
<br>
<br>
<p id="text">Text</p>
</body>
</html>
05
2022-12
02
2022-12
02
2022-12
29
2022-11
29
2022-11
24
2022-11