Is there any way to hide the text in a HTML element, and not the element itself, using JavaScript? So if one had
<span style="border: 1px solid green">Hello world!</span>
how could one hide the “Hello world!” but not the border? If there is also a simplified jQuery solution, can you include it too?
Yes there is. it’s called
.wrapInner().DEMO: http://jsfiddle.net/9KzgJ/