Home >Web Front-end >JS Tutorial >JS method to automatically add a cell by clicking a button_javascript skills

JS method to automatically add a cell by clicking a button_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-16 16:10:381014browse

The example in this article describes the JS method of automatically adding a cell by clicking a button. Share it with everyone for your reference. The specific analysis is as follows:

This is a special effect code for online self-service generation of forms on a web page.
The core function code is implemented in JS. Click the add button on the web page and a cell will be automatically added to the web page

Copy code The code is as follows:



js dynamically generates tables


<script><br> function creates(){<br> newiframes=document.createElement("TABLE")<br> newiframes.id="t1"<br> newiframes.width="100"<br> newiframes.border="1"<br> newiframes.height="100"<br> newiframes.align="left"<br> newiframes.style.background="blue"<br> newiframes.insertRow()<br> newiframes.rows[0].insertCell()<br> document.body.insertBefore(newiframes)<br> }<br> </script>





I hope this article will be helpful to everyone’s JavaScript programming design.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn