0
Why do we need to create HTML elements via jQuery, while we can do it directly in the html file ?
3 Réponses
+ 1
Updating a table element. Or say, in an order form where you have to accept multiple entries without knowing how many the user would enter in the first place.
This comment section is also an example. After pressing `post`, HTML elements are constructed and appended to this section.
Those things would have you create an element and append it to the appropriate place.
0
You cannot create HTML elements with just HTML. You need Javascript for it and jQuery is one of the more popular libraries to use. You can use plain Javascript, if you like.
0
Jomari Pantorilla Great. but can you provide an example about a certain case when we will desperately need to add elements by JS ?