0

Why do we need to create HTML elements via jQuery, while we can do it directly in the html file ?

9th Feb 2019, 4:58 PM
Nael Sharabi
Nael Sharabi - avatar
3 Antworten
+ 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.
9th Feb 2019, 6:06 PM
Jomari Pantorilla
Jomari Pantorilla - avatar
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.
9th Feb 2019, 5:55 PM
Jomari Pantorilla
Jomari Pantorilla - avatar
0
Jomari Pantorilla Great. but can you provide an example about a certain case when we will desperately need to add elements by JS ?
9th Feb 2019, 5:59 PM
Nael Sharabi
Nael Sharabi - avatar