jquery - JavaScript modify CSS for multiple divs -


i have function tied anchor , on click, modifies display of div display none block.

in div have anchor want use hide parent div.

see mock-up below:

<a href="#" onclick = "showtext(); return false;" id="btnews">click</a> 

this modifies allsources div display block:

  <div id="essentialsourcestab"></div>     <div id="allsourcestab">  <a href="#" class="inline_link allsourceslink" id="showbottom"  onclick = "hidetext(); return false;">     </div> 

i managed first function work, modifies css allsourcestab display block , hides essentialsourcestab, however, cannot other anchor(showbottom) work. basically, want use hide allsourcestab , display essentialsourcestab

 function showtext() {         document.getelementbyid("allsourcestab").style.display = "block";         document.getelementbyid("essentialsourcestab").style.display = "none";     }     document.getelementbyid("btnews").click = showtext;  function hidetext() {             document.getelementbyid("allsourcestab").style.display = "none";             document.getelementbyid("essentialsourcestab").style.display = "block";         }         document.getelementbyid("showbottom").click = hidetext; 


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -