Click the add button and delete button respectively
I want elements and text boxes to be added and removed
// Element to move
Element A
// Add button
<input type = "button" value = "add">
// Delete button
<input type = "button" value = "Delete">
<form method = "post" action = "">
<p>
<input type = "text" placeholder = "name of icon" name = "icon">
</p>
<p>
Element A
<input type = "text" value = "Please click ☆" name = "zahyou">
</p>
// Send
<p>
<input type = "submit" value = "next" name = "send">
</p>
-
Answer # 1
-
Answer # 2
Add button I want to be able to add and delete "elements I want to move" and "text box" (element A in this case) by pressing the delete button.
I can move only one of them with my knowledge now, so I want to add or delete multipleThe essential problem is the same as the previous question, so please reread all the answers to the previous question.
https://StackOverflow.com/questions/225839Problem "If you want to specify an additional position corresponding to an additional button, you can't implement it with my skill unless you prepare as many event handlers as there are buttons."
The solution is to prepare a map or specify a relative position, as in the previous answer.
https://developer.mozilla.org/en/docs/Web/API/NodePreparecorresponding mapof add button and location
Add torelative position(parent/child, brother/brother) corresponding to the add button
Re: minomonnta-san
-
Answer # 3
Element inherits node (node derived object), so you can use the properties and methods of the parent node.
If you also check the node implementation, there are the following methods:
Node.appendChild ()
Node.removeChild ()
Node.replaceChild ()
There are also the following implementations:
ParentNode.append ()
ParentNode.prepend ()
ChildNode.remove ()
When reading the MDN, the parent object implementation should check the parent object's page, while the target object's page explains what the parent (derived from) object is.
Search for "object inheritance" to see why aelement can use a node implementation.
Related articles
- javascript - i want to remove the unwilling overlap of elements
- javascript - i want to add the html element at the bottom to the top as well
- javascript - i want to add forms side by side with appendchild
- javascript - i want to use filter to remove only elements that contain an empty array from an object
- python 3x - how to remove 0 elements in numpy 2darray
- javascript - i want to output a video on the web
- javascript - i want to disable the selection box
- i want to get the coordinates of the javascript div area
- i want to get the coordinates of the javascript div area 2
- javascript - dynamically added elements are called multiple times
- javascript - i want to make a web page with gas, but it is not displayed well
- javascript - i want to get data from array
- [javascript] i want to show/hide elements on the browser
- javascript - i want to know how to identify a user with a web application
- javascript - convert elements (numbers) divided in an array from strings to numbers
- i want to check the elements of a multidimensional array with javascript
- javascript - i want to display google map in the view
- i want to raise the same event for multiple elements with javascript, but the event does not occur (modal window example)
- php - i want to remove commas from the data in $this-> data
- javascript - i want to count the number contained in the elements of an array
- javascript : How to make the function apply to each element? (Remove placeholder on focus on input)
- javascript : The lightest possible template engine for a static site
- javascript : Correct imitation of a long page load
- javascript : How to make sure that if a person has an incorrect path in the address bar, then the site will automatically redire
- javascript : Displaying data from a google table on the site
- How to change the text of a button when hovering over it using css or javascript?
- javascript : How to restart initialization of Swiper Slider?
- javascript : why is
First of all,
In contrast,
What kind of UI do you want to process multiple times
How to reflect in form and how to process in form
Please pack etc.