Get the App
SLTechnology News&Howtos  ›  Development  › 

How to write the code of Mini Program for JavaScript order operation

Shulou Source: shulou.com Published: 2022-05-31 23:22:08 10月04日 Update

Most people don't understand the knowledge points of this article "How to write the code of JavaScript order operation Mini programs," so Xiaobian summarizes the following contents for everyone, with detailed contents, clear steps and certain reference value. I hope everyone can gain something after reading this article. Let's take a look at this article "How to write the code of JavaScript order operation Mini programs."

The specific code is as follows

Title table { text-align: center; } function delRow(id) { //Get the line to delete var row = document.getElementById(id);//find rows by id var table = document.getElementById('mytb'); table.deleteRow(row.rowIndex);//Delete the contents of a row according to the row index } function addrow() { var mytb = document.getElementById('mytb'); var index = mytb.rows.length - 1;//Get the index of the insertion target, a row var row = mytb.insertRow(index);//Insert a row into a position, insert a row var id = 'row' + row.rowIndex;//concatenation id row.setAttribute('id', id);//set id var td0 = row.insertCell(0);//td0 Create a cell td0[xss_clean] = "Beautiful, durable and wear-resistant sofa two-piece set";//Set the content of td0 var td1 = row.insertCell(1); td1[xss_clean] = row.rowIndex;//Assign row index to the contents of td1 var td2 = row.insertCell(2);//Insert td2 into a cell td2[xss_clean] = ''; } function update(id) { var row = document.getElementById(id); var td1 = row.cells[1]; var v = td1[xss_clean]; td1[xss_clean] = ''; row.cells[2][xss_clean] = ''; } function comfirmrow(id) { var row=document.getElementById(id); var td1=row.cells[1];//Get the second cell of each row var input=td1.firstChild;//get input label var v=input.value;//get the input content td1[xss_clean]=v;//assign content to td1 var td2=row.cells[2]; td2[xss_clean] = ''; } trade name number operation Beautiful durable super wear-resistant sofa two-piece set 24 The above is about "JavaScript order operation Mini programs code how to write" the content of this article, I believe everyone has a certain understanding, I hope the content shared by Xiaobian is helpful to everyone, if you want to know more relevant knowledge content, please pay attention to the industry information channel.

Tags: Content code programs orders units indexes good-looking durable wear-resistant piece sets articles sofas knowledge articles lines values locations goods most of which are Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei MariaDB Shulou Tech Info Shulou Information macOS