60
rated 0 times
[
65]
[
5]
/ answers: 1 / hits: 55238
/ 13 Years ago, mon, july 4, 2011, 12:00:00
In javascript suppose you have this piece of code:
<div>
<script type=text/javascript>var output = 'abcdefg';</script>
</div>
Is there any way to simply echo (using PHP terminology) the contents of output
into #test
? That is, to output a string inline, assuming you have no standard way of traversing or selecting from the DOM?
document.write(...);
does write the contents of output
, but in doing so, it replaces the entire document with the output
.
The solution I'm looking for should act the same way a PHP echo
would: write the output into the document inline.
More From » echo