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
Post a Comment