This week's book giveaway is in the Testing forum.
We're giving away four copies of Practical Unit Testing with TestNG and Mockito and have Tomek Kaczanowski on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes HTML & Javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "HTML & Javascript" Watch "HTML & Javascript" New topic
Author

HTML & Javascript

sanchek agrawal
Greenhorn

Joined: Apr 14, 2003
Posts: 2
how can i access the value of a javascrifpt variable in HTML
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50674

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 ]

[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
sanchek agrawal
Greenhorn

Joined: Apr 14, 2003
Posts: 2
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 ?
Rajeshwari Natarajan
Ranch Hand

Joined: Mar 05, 2003
Posts: 67
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


regards<br />Rajeshwari. N
 
 
subject: HTML & Javascript
 
Threads others viewed
How To Set All the Textfields in a Web Page to READONLY?
Simple question concerning dates, JSP and Javabeans
Using color in a pane
Formatting in XML
Default Body Content
IntelliJ Java IDE