I’m trying to get the width of a <a> element.
I’ve found solutions on the internet like.
var test = document.getElementById("bla").style.pixelWidt;
var test = document.getElementById("bla").offsetWidth;
var test = document.getElementById("bla").clientWidth;
But none of these seems to work properly for my <a> elements.
I need the pixel length to set the size of an inputbox and place it over the link for the user to adjust it.
I tried already the solution you provided (see previous message) but the input box just isn’t the same size as the <a> element.
I just tried the following and that seems to work:
I find the number of characters of the link and then set the width of the inpubox like follows:
document.getElementById('tex').style.width = test * 9.2 + "px";