2014-08-10, 03:57 PM
(2014-08-10, 09:19 AM)Euan T Wrote: [ -> ](2014-08-09, 09:54 PM)Eric J. Wrote: [ -> ]This should be what you want, you'll have to include jQuery though.
<script type="text/javascript"> function showHide(obj) { var div = document.getElementById(obj); $(div).slideToggle(); } </script>
If you're already including jQuery, why not use it to select the div too? Would be far simpler.
Well, he said he didn't know much about JS, and I'd imagine he has some inline JS that he'd have to change on an element if the whole script were changed.
But it certainly would be less code.