How to dynamically create tags and set attributes in js

小云云
Release: 2018-02-26 09:08:42
Original
2687 people have browsed it

When we write jsp pages, we often encounter this situation: the number of data obtained from the background is uncertain. At this time, when writing jsp pages on the front end, we are not sure how to design it. At this time, you need to dynamically create tags through js:

1. Create a certain tag: Create an instance of p in the body as follows;