Hello, Can someone please explain how I can change the text below ("Some Text") to some other text by clicking on another label located elswhere on the form. <label>Some Text</label> Thanks.
1. The label you click ON should look like this: <label onclick="changeLabel('labelcontent');" style="cursor: pointer;">click me!</label> Code (markup): 2. The label you want to CHANGE should look like this: <label id="labelcontent">Some Text</label> Code (markup): 3. Create the function which does the work, along with the new text: var label_texts = new Object(); label_texts["labelcontent"] = "This is the new text!"; function changeLabel(id) { document.getElementById(id).innerHTML = label_texts[id]; } Code (markup): The way I've set it up is open-ended, you can click/replace any number of labels by just defining a new target id (like "labelcontent"), and then create an entry for it in the label_texts array in step 3.