PDA

View Full Version : Simple Question About Using Vars


eyalros
04-11-2007, 06:25 AM
Hello.
How (I mean, in which syntax) Can I do the following thing:

function new_Photo_Text(number) {
div[PUT HERE "NUMBER" VAR].style.height='100';
div[PUT HERE "NUMBER" VAR].style.visibility='visible';
document.all.i[PUT HERE "NUMBER" VAR].style.height='100';
i1.location='create_new/photo_text.php?block=1&page_id=<? echo $page_id; ?>&align=left';
}

Thanks!

eyalros
04-12-2007, 05:04 AM
Maybe I didn't explained myself well.
My Question is what shoulld I write so I can put the "numbers" var into the javascript text.
The same way I do this:
document.write='hello' + name + ' how are you';
Or in PHP:
hi <? echo $name; ?>

Just want to add the value of "numbers" var into the places where there is red words.
How can I do that?

Jon Hanlon
04-12-2007, 07:47 AM
var elementName = "myDiv"; // or you could prompt for a string here
var element = document.getElementById(elementName);
element.style.visibility = 'hidden';