[help] modify a label

L

little_shoe

hi all,
I need to modify a label value into a form.

I read about the "label" tag but it doesn't seem to have any value
attribute.
how can I do it using javascript?

thanks...


laura
 
B

Bruno Poupier

little_shoe said:
hi all,
I need to modify a label value into a form.

I read about the "label" tag but it doesn't seem to have any value
attribute.
how can I do it using javascript?

Could you post a sample of your code here?
 
L

Lasse Reichstein Nielsen

little_shoe said:
I need to modify a label value into a form.

I read about the "label" tag but it doesn't seem to have any value
attribute.
how can I do it using javascript?

The label is a normal inline HTML element, like the <em> tag. The
content of the label is the text inside. It is not an attribute.

To change the content, you need a browser that allows dynamic update
of the page content (where, e.g., Netscape 4 doesn't).

How to modify the page is in the FAQ:
<URL: http://jibbering.com/faq/#FAQ4_15 >
although that uses the proprietary innerHTML property.


/L
 
L

little_shoe

My resolution:
I have two different <label> labelA and labelB in the same position.
When a specified event occures (ie.a checkbox is checked) my js function use
the "hidden" attribute to display labelA or labelB according to the
requirement...

maybe is a poor solution, but it works...
thanks for your suggestion

laura
 
S

Shawn Milo

little_shoe said:
hi all,
I need to modify a label value into a form.

I read about the "label" tag but it doesn't seem to have any value
attribute.
how can I do it using javascript?

thanks...


laura

Sounds like you could do what you want by using a
span and the innerHTML value.

In HTML:
<span id="changeMe"></span>

In JS:
document.getElementById('changeMe').innerHTML = 'hello';



Shawn
 

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

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,130
Latest member
MitchellTe
Top