Online Shopping : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to
Did You Find This Entry Useful?

3 of 3 people (100%) answered Yes
Recently 3 of 3 people (100%) answered Yes


How i can use java script variables in html text field

Apr 8th, 2008 18:49
ha mo, Dave Clark, Raed Alasby,

     You cannot do that directly, of course, but there are no limits 
to what you can do with DHTML in this area.  I don't know the specific 
scenario you had in mind, but there are at least two ways to 
accomplish the insertion of JavaScript information into an HTML 
     The first method can only be used during the initial load of the 
  <script type="text/javascript">
     The second method can be used at any time -- either during inital 
load of the document or not.  This is the arrangement for initial 
document load:
<div id="dyna_div"></div>
<script type="text/javascript">
document.getElementById('dyna_div').innerHTML = javascript_info;
     Using the same method after document load merely requires that 
you place that line of code into a function and have the function 
driven by some DHTML user event.
Take care,
Dave Clark