Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to delete a control by javascript

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article focuses on "how to delete controls in javascript". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "how to delete controls in javascript"!

Javascript delete control methods: 1, get the number of rows of the current TABLE; 2, add the current row of columns; 3, add a button control; 4, through "Function Delete () {...}" to delete the control.

This article operating environment: windows7 system, javascript1.8.5 version, Dell G3 computer.

How does javascript delete a control?

JS dynamically add and delete controls

The code implemented in TABLE:

Function Add () / add control {var nRow=document.all.Table1.rows.length; / / get the number of rows of the current TABLE var objTheRow=document.all.Table1.insertRow (nRow); / / add objTheRow.insertCell (0); / add a button control objTheRow.cells (0) [xss_clean] = ";} Function Delete () / delete the control {var currRowIndex= [XSS _ clean] [xss_clean] .rowIndex / / get the current index document.all.Table1.deleteRow (currRowIndex); / / perform delete} so far, I believe you have a better understanding of "how to delete controls in javascript". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report