Debt Consolidation - Debt Consolidation - Online Advertising - Debt Consolidation - WoW Gold

PDA

View Full Version : how to access labels on a web form


kiran1785
Apr 13th 2007, 11:23 pm
Hi,

can someone plzz tell me which javascript function(s) can be used to access labels on a web form??

Thanks
Kiran

mjamesb
Apr 13th 2007, 11:54 pm
You need to provide a bit more information and some sample code. In general the only way to access a specific element on the page that is not an "input" type of element inside a form is to put an id on the element. If when you say label you actually mean a label element you need to put an id on it.

<label id="label1">Text...</label>

<script language="javascript">
var lbl = document.getElementById("label1");
lbl.innerHTML = 'new text';
</script>