Ask Your Question
2

How do you change the HTML span classes to @data-id?

asked 2022-01-15 11:00:00 +0000

nofretete gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-06-09 08:00:00 +0000

plato gravatar image

To change HTML span classes to @data-id, you need to modify the HTML code as follows:

original code:

<span class="my-class">Hello World!</span>

modified code with @data-id:

<span data-id="my-class">Hello World!</span>

In this case, the "class" attribute has been replaced by "data-id" attribute, and the original class name "my-class" has been moved to the value of the "data-id" attribute.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-01-15 11:00:00 +0000

Seen: 16 times

Last updated: Jun 09 '22