当前位置:网站首页>JS native implementation for loop rendering array
JS native implementation for loop rendering array
2022-06-22 07:19:00 【Small orange table】
Realization effect :
<!DOCTYPE html>
<html>
<title>js Native implementation for Loop render array </title>
<head>
<style type="text/css"> #wrapper {
background-color: pink; } #wrapper .row {
border: 1px solid #000; } .row div{
border: 1px solid #000; display: inline; } </style>
</head>
<body>
<div id="wrapper"></div>
</body>
<script> function doJsFor() {
var checkedArray = [0,2];// Selected array subscript var someArray = [ {
name:'dream',value:0}, {
name:'prescription',value:1}, {
name:'tribe',value:2}, ] var elementArray = []; for(let i=0;i<someArray.length; i++){
var isChecked = false var isChecked = '' for(let j=0;j<checkedArray.length; j++){
if(someArray[i].value=== checkedArray[j]) {
// Array of value Equal to the value of the selected array , Then select the check box isChecked = true } } str = `<div class="row" ><div><input type="checkbox" ${
isChecked?'checked':''} name="vehicle" value="${
someArray[i].value}" /></div> <span>${
someArray[i].name}</span> </div>`; elementArray.push(str) } document.getElementById("wrapper").innerHTML = elementArray.join('') } doJsFor(); </script>
</html>
边栏推荐
- PDF转图片实现方式
- Notes on advanced combinatorics -- Conclusion
- Matlab用深度学习循环神经网络RNN长短期记忆LSTM进行波形时间序列数据预测
- 圣杯布局和双飞翼布局的区别
- Developing a contract application with low code
- 低代码开发一个合同应用
- How to prevent event propagation in JS
- Vue failed to connect to MySQL database
- Yolov1 (training process)
- Kinect azure based multi camera data collection (I)
猜你喜欢

低代码开发一个合同应用

【GAN】《ENERGY-BASED GENERATIVE ADVERSARIAL NETWORKS》 ICLR‘17

Convolutional neural network (notes, for personal use)
![[out of distribution detection] deep analog detection with outlier exposure ICLR '19](/img/65/4f974a33c1d76be97b131397de0fee.jpg)
[out of distribution detection] deep analog detection with outlier exposure ICLR '19

CNN模型合集 | Resnet变种-WideResnet解读

33岁程序员的年中总结

Canoe learning notes (6) diagram of logging block data recording module

antd 框架:点击链接重开浏览器页面——基础积累

【GAN】SentiGAN IJCAI’18 Distinguished Paper

架构图颜色搭配
随机推荐
Chromedriver所有版本下载
js实现随机生成16位的密钥——基础积累
The pit on the school recruitment Road
Matlab uses deep learning recurrent neural network RNN long-term and short-term memory LSTM to predict waveform time series data
精益生产|精益管理
[meta learning] classic work MAML and reply (Demo understands meta learning mechanism)
5g NR PWS system
sessionStorage 和 localStorage 的使用
Rviz ROS wiki official website tutorial learning notes (1) - User Guide
【GCN-RS】UltraGCN: Ultra Simplification of Graph Convolutional Networks for Recommendation (CIKM‘21)
咖啡供应链是如何被趟平的?
【实习】跨域问题
Use of sessionstorage and localstorage
Wechat applet camouflage page (change the page content regularly)
Tikz learning notes (IV) further exploration of circle and complex geometry
Thousands of sails pass by the side of the sunken boat, and thousands of trees spring before the diseased tree
TypeScript & 详细解释 in、keyof、extends、索引签名、Record、typeof 的含义(不定时更新)
Selenium anti crawl and analog mobile browser
[Gan] Introduction to Gan basics and dcgan
[anomaly detection] malware detection: mamadroid (dnss 2017)