I need to display JS variable in HTML.
<script language="JavaScript">
function showHide(toShow,toHide,theValue) {
obj = document.getElementById(toShow);
obj2 = document.getElementById(toHide);
obj.style.display = 'block';
obj2.style.display = 'none';
}
</script>
but I need to display "theValue" in HTML. I heard about this:
<script type="text/javascript">
document.writeln(theValue);
</script>
But this "theValue" is not global variable. How can I make it global variable? (out of function).
<table><tr><td onMouseOver="showHide(2,1,67);">sss</td></tr></table>
<div id="2" style="display:none;"> number "variable" </div>