Appending a character to end of a var's value?

M

Mechphisto

Let's say I have two DIV tags with the ID's "block1" and "block1b".
I have a JS function to hide one and show the other.
I want to tell the JS to use the pre-determined ID for a 2nd process,
but add the "b" to the end of the value in order to affect the 2nd ID.
How do I do that?

I've tried:

var e = document.getElementById(i);
if (e) {
e.style.display = 'block';

var g = e.value+b;
g.style.display = 'none';
}
and variations on that, like:
var g = e."b";
g.style.display = 'none';
but nothing seems to work.

Any suggestions?
Thanks,
Liam
 
T

Thomas 'PointedEars' Lahn

Mechphisto said:
Let's say I have two DIV tags with the ID's "block1" and "block1b".
I have a JS function to hide one and show the other.
I want to tell the JS to use the pre-determined ID for a 2nd process,
but add the "b" to the end of the value in order to affect the 2nd ID.
How do I do that?

I have answered that in reply to (e-mail address removed), a few
minutes ago, already.

Don't multi-post, and please get a real name. <http://jibbering.com/faq/>


PointedEars
 
M

Mechphisto

I have answered that in reply to (e-mail address removed), a few
minutes ago, already.

Don't multi-post, and please get a real name.  <http://jibbering.com/faq/>

PointedEars

I have no idea what you mean by "a real name", seriously. Was that an
insult?
And I originally posted under that email address erroneously. I don't
want crawlers to pick up that address for spam and realized the
mistake too late.
I tried to use Google Groups to recall the message as soon as I
noticed it...but I figure that it must have already been picked up by
some newsgroup clients. Sincere apologies for that.
-Liam
(I like my name)
 
T

Thomas 'PointedEars' Lahn

Mechphisto said:
Thomas said:
Mechphisto said:
Let's say I have two DIV tags with the ID's "block1" and "block1b".
I have a JS function to hide one and show the other.
I want to tell the JS to use the pre-determined ID for a 2nd process,
but add the "b" to the end of the value in order to affect the 2nd ID.
How do I do that?
I have answered that in reply to [...@...], a few minutes ago, already.

Don't multi-post, and please get a real name.
<http://jibbering.com/faq/>
[...]

Please trim your quotes as explained and recommended in e.g. the FAQ.
I have no idea what you mean by "a real name", seriously.

Well, the short variant of the name in your ID card, passport, or
certificate of birth. Your *real* name as opposed to your *nick* name.
Was that an insult?

As indicated by the `please', it was a polite request. No offense meant.
And I originally posted under that email address erroneously. I don't
want crawlers to pick up that address for spam and realized the
mistake too late.

Sorry for helping the crawlers, then. I have already removed my message
from my news server and GG in order to counteract negative effects. (I
should have replied to this via e-mail only in the first place.)
I tried to use Google Groups to recall the message as soon as I
noticed it...but I figure that it must have already been picked up by
some newsgroup clients.

Yes, Google Groups (G2/1.0) is well-known to be good for Usenet research,
but inadequate for posting. Try Mozilla Thunderbird 2.0.0.1x or KNode
0.10.x instead.
Sincere apologies for that.
Accepted.

-Liam
(I like my name)

Add me :)


F'up2 poster (please reply to this via e-mail only)

PointedEars
 

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

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top