课程: Learning Full-Stack JavaScript Development: MongoDB, Node, and React

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Reading form data with the DOM API

Reading form data with the DOM API

- [Instructor] The next step would be to propose a new name and this is going to be our first update operation, and it has multiple elements to it. The first task would be to create a form so that the user can submit the name, that's straightforward, it's just HTML so I'm going to add it here somewhere. Another title DIV, this time let's label it propose a new name, and in a body DIV, we need a form element, we don't need an action, this action is to submit the form regularly, not with JavaScript and within the form, we need an input text. To identify that input we can use either the name or the ID. I'm going to use the name to show you how to deal with that through the DOM API, let's name it new name and we can also add a placeholder here with a text like new name here. The other thing that we need for the form is a submit button so we'll do a button, submit, with a label, submit. Let's take a look at that form, and…

内容