• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HTML & Javascript

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how can i access the value of a javascrifpt variable in HTML
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You don't. You access a JavaScript variable from JavaScript, which may be embedded in HTML using <script> tags (or in tag attributes that are interpreted as JavaScript "scriptlets").
What are you actually trying to do?
bear
[ April 14, 2003: Message edited by: Bear Bibeault ]
 
sanchek agrawal
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a javascript function,in which i have a vaiable say strAccessVal. I want to access this value in my HTML code
<input type = text value = "" strAccessVal>
where strAccess may contain "readonly" or "".
so how do I do this ?
 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
U cannot access the javascript variable in HTML.
What u can do is, set the value of the text field to strAccessVal in javascript itself.
the code will be something like
reply
    Bookmark Topic Watch Topic
  • New Topic