search

Home  >  Q&A  >  body text

javascript - Ask jq about distinguishing element types.

If the p in the picture is of different types, I now want to put the different types of p into the object (the object consists of the top, left and id of p) to form an array. How can I distinguish different types of p in the upload background? Woolen cloth? Add different classes to p and judge? Thanks!

过去多啦不再A梦过去多啦不再A梦2815 days ago588

reply all(2)I'll reply

  • 阿神

    阿神2017-05-19 10:44:27

    Since it is a type, you can generally add a class without style. You can also use data-type="a" like this.

    I guess the questioner wants to make a drag-and-drop layout?

    reply
    0
  • 世界只因有你

    世界只因有你2017-05-19 10:44:27

    Generally use the form of "data-xx" to distinguish and bind. The frontend can use js to do ajax to tell the backend which type of elements need to be processed.

    reply
    0
  • Cancelreply