JSFiddle - React, Tailwind, and code Playground

by dmethvin

JavaScript

var text = '<a href="/ra?a=b&divide_money=both&d=e&nbsp_ace=false">test</a>'
//href gets changed into /ra?a=bĂ·_money=both
console.log( $(text).attr('href'))
    
    
var div = document.createElement("div");
div.innerHTML = text;
console.log(div.getAttribute("href"));

var text = '<a href="/ra?a=b&amp;divide_money=both&amp;d=e&amp;nbsp_ace=false">test</a>'

console.log( $(text).attr('href'))
    
var div = document.createElement("div");
div.innerHTML = text;
console.log(div.getAttribute("href"));