generate functionTue, 08 Nov 2022

get string, convert <a> tags to <div> with onclick on the href attribute

function convert($string) { // convert string to dom // get all <a> tags // convert to <div> // add onclick to the converted divs // convert dom back to string // return the string }

Questions about programming?Chat with your personal AI assistant