There is a construct like <div id="show_chosen_address"></div>
, and you need to insert it inside the span
block. There are no problems with the creation of a span, its class and its contents, but when I try to insert a span into a block, [object HTMLSpanElement]
(via console.log (number_span)) shows everything correctly, what you need to insert).
I do this:
var div = document.getElementById('show_chosen_address'), number_span = d.createElement('span'); number_span.className = "number"; number_span.innerHTML = "test"; div.innerHTML = number_span;