display a variable

P

Phil

Hi,

I'm missing some concept here. If I define a variable in
my html code:

var somedata = "this is a test"

Can't I have display the data in this variable (this is a
test) anywhere on the page and if so how?

Thanks,
Phil
 
J

jon spivey

Hi Phil,
HTML doesn't do variables - I'm assuming from the var you're meaning
javascript. If so
<script type="text/javascript">
var something = "stuff">
document.write(something) // write it to the screen
alert(something) //write it in a message box
</script>
if this doesn't help you can you post back with more info on what you're
aiming to do

Jon
Microsoft MVP - FP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top