html - tag next to a label in javascript -
i not have luxury of using jquery, want hide span tag in conditions using javascript , span tag not have id.
"<label name="lcity" id="lcity" for="city" class="formlabel" title="city">city:</label> <span class=spanclass>*</span>
i tried , did not work:
var countyfieldlabel = document.getelementbyid('lcity').nextelementsibling; countyfieldlabel.visibility="hidden";
can suggest please?
thanks
you go right:-
visibility
not element attribute instead style attribute.
use
countyfieldlabel.style.visibility="hidden";
instead of
countyfieldlabel.visibility="hidden";
Comments
Post a Comment