html - Jquery Toggle visibility button -
im trying make button should make 1 element hiding (display: none;) , 1 visible , vice versa.
here example of sort of thing ive got:
at moment when clicking 'technical details' changes display: none; display: block; on element. need make element under hidden when 1 shown...
here code im using...
function toggle() { var ele = document.getelementbyid("toggletext"); var text = document.getelementbyid("displaytext"); if(ele.style.display == "block") { ele.style.display = "none"; text.innerhtml = "technical details"; } else { ele.style.display = "block"; text.innerhtml = "product information"; } }
hope makes sense , in advance...
why don't wrap 2 different text html elements in span , give them , links class called "toggleprdctandtech". set default hidden ones display:none; can toggle them in function this
function toggleelements(){ $(".toggleprdctandtech").toggle(); }
Comments
Post a Comment