I have a span tag inside with there is some html code to create some corners and other things. Now using javascript i want to add some captions to it.The constraint is the original content of span should not get overwritten.
Eg
<span> <!-some more complicated html code </span>
Now i want to add caption in span so that span should look like
<span> NEW CAPTION <!-some more complicated html code </span>
How can i do it?
document.getElementById.innerHtml = "NEWCAPTION" + document.getElementById.innerHtml
is this correct?
You will need to give the span an ID if you going to do it that way. Also the innerHtml should be innerHTML
eg.
<span id="mySpan"> <!-come more complecated html code </span>
document.getElementById('mySpan').innerHTML = "NEWCAPTION" + document.getElementById('mySpan').innerHTML
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With