How can I detect onclick() or similar for individual characters in a text?

前端 未结 6 2126
你的背包
你的背包 2020-12-20 21:49

I\'m new to Javascript and would like to modify a text string by clicking on individual characters. The string is: 0000 0000 0000 0000 representing a binary num

6条回答
  •  感情败类
    2020-12-20 22:20

    You'd need to add a container round each character, preferably an inline div or a span. This question has an excellent example on adding wrapper to each character:

    JavaScript regular expression: inserting span tag for each character

提交回复
热议问题