for example if i want to display text from javascript side by side like this
text1 text2 text3
so I typed this code
<p id=displayText> <p>
<script type="text/javascript">
function doSomeThing()
{
//do something
document.getElementById("displayText").innerHTML=text1;
//do something
document.getElementById("displayText").innerHTML=text2;
//do something
document.getElementById("displayText").innerHTML=text3;
}
</script>
I got only
text3
how can I do it.
you set the texts to the same ID. Create 3 ids, not only one.
do this or that :