When using js to generate a tag, how to generate attributes like data-v-84976fe6

<a data-v-84976fe6 href="javascript:;" class=""><span data-v-84976fe6=""></span></a>

after using document.createElement ("a") to create a tag, how to add data-v-84976fe6 this attribute

Jul.03,2022

var tagA = document.createElement("a");
tagA.dataset['v-84976fe6']=""

Custom properties of DOM, which can be obtained and set through dataset


var a=document.createElement("a");
a.setAttribute("data-v-84976fe6","new")//

getAttribute () method to get


var tag=document.getElementsByTagName ("a");
tag.setAttribute ('data-v-84976fe6', "value");

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3067d-340da.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3067d-340da.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?