Get the details of an article with a html tag later. How to wrap an a tag for the img tag in this paragraph and add a custom attribute to the a tag

clipboard.png









"


Mar.04,2021

after getting the img tag, use the beforeBegin method and then use the setattribute method to add custom attributes


var str='

<img src="/Upload/image/20180419/small/20180419160436_5324_160436_i160436.jpg">

'; var s=str.replace(/(<img [^<]+>)/ig,'<a data-name="aa">$1</a>') console.log(s)
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-1b3dc30-e90c.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-1b3dc30-e90c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?